Class: CardDB::Deck

Inherits:
Resource show all
Defined in:
lib/carddb/collection.rb

Overview

Wrapper for hosted Deck objects

Instance Attribute Summary

Attributes inherited from Resource

#client, #data

Instance Method Summary collapse

Methods inherited from Resource

#[], #initialize, #key?, #to_h, #to_json

Constructor Details

This class inherits a constructor from CardDB::Resource

Instance Method Details

#account_idObject



773
774
775
# File 'lib/carddb/collection.rb', line 773

def 
  data['accountId']
end

#api_application_idObject



777
778
779
# File 'lib/carddb/collection.rb', line 777

def api_application_id
  data['apiApplicationId']
end

#created_atObject



821
822
823
# File 'lib/carddb/collection.rb', line 821

def created_at
  parse_time(data['createdAt'])
end

#descriptionObject



793
794
795
# File 'lib/carddb/collection.rb', line 793

def description
  data['description']
end

#entriesObject



817
818
819
# File 'lib/carddb/collection.rb', line 817

def entries
  @entries ||= (data['entries'] || []).map { |entry| DeckEntry.new(entry, client: client) }
end

#external_refObject



805
806
807
# File 'lib/carddb/collection.rb', line 805

def external_ref
  data['externalRef']
end

#format_keyObject



797
798
799
# File 'lib/carddb/collection.rb', line 797

def format_key
  data['formatKey']
end

#gameObject



785
786
787
# File 'lib/carddb/collection.rb', line 785

def game
  @game ||= data['game'] ? Game.new(data['game'], client: client) : nil
end

#game_idObject



781
782
783
# File 'lib/carddb/collection.rb', line 781

def game_id
  data['gameId']
end

#idObject



769
770
771
# File 'lib/carddb/collection.rb', line 769

def id
  data['id']
end

#metadataObject



813
814
815
# File 'lib/carddb/collection.rb', line 813

def 
  data['metadata'] || {}
end

#source_urlObject



809
810
811
# File 'lib/carddb/collection.rb', line 809

def source_url
  data['sourceUrl']
end

#titleObject



789
790
791
# File 'lib/carddb/collection.rb', line 789

def title
  data['title']
end

#updated_atObject



825
826
827
# File 'lib/carddb/collection.rb', line 825

def updated_at
  parse_time(data['updatedAt'])
end

#visibilityObject



801
802
803
# File 'lib/carddb/collection.rb', line 801

def visibility
  data['visibility']
end