Class: CardDB::Deck
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
Instance Method Details
#account_id ⇒ Object
773
774
775
|
# File 'lib/carddb/collection.rb', line 773
def account_id
data['accountId']
end
|
#api_application_id ⇒ Object
777
778
779
|
# File 'lib/carddb/collection.rb', line 777
def api_application_id
data['apiApplicationId']
end
|
#created_at ⇒ Object
821
822
823
|
# File 'lib/carddb/collection.rb', line 821
def created_at
parse_time(data['createdAt'])
end
|
#description ⇒ Object
793
794
795
|
# File 'lib/carddb/collection.rb', line 793
def description
data['description']
end
|
#entries ⇒ Object
817
818
819
|
# File 'lib/carddb/collection.rb', line 817
def entries
@entries ||= (data['entries'] || []).map { |entry| DeckEntry.new(entry, client: client) }
end
|
#external_ref ⇒ Object
805
806
807
|
# File 'lib/carddb/collection.rb', line 805
def external_ref
data['externalRef']
end
|
797
798
799
|
# File 'lib/carddb/collection.rb', line 797
def format_key
data['formatKey']
end
|
#game ⇒ Object
785
786
787
|
# File 'lib/carddb/collection.rb', line 785
def game
@game ||= data['game'] ? Game.new(data['game'], client: client) : nil
end
|
#game_id ⇒ Object
781
782
783
|
# File 'lib/carddb/collection.rb', line 781
def game_id
data['gameId']
end
|
#id ⇒ Object
769
770
771
|
# File 'lib/carddb/collection.rb', line 769
def id
data['id']
end
|
813
814
815
|
# File 'lib/carddb/collection.rb', line 813
def metadata
data['metadata'] || {}
end
|
#source_url ⇒ Object
809
810
811
|
# File 'lib/carddb/collection.rb', line 809
def source_url
data['sourceUrl']
end
|
#title ⇒ Object
789
790
791
|
# File 'lib/carddb/collection.rb', line 789
def title
data['title']
end
|
#updated_at ⇒ Object
825
826
827
|
# File 'lib/carddb/collection.rb', line 825
def updated_at
parse_time(data['updatedAt'])
end
|
#visibility ⇒ Object
801
802
803
|
# File 'lib/carddb/collection.rb', line 801
def visibility
data['visibility']
end
|