Class: Pokemon::Set
- Inherits:
-
Object
- Object
- Pokemon::Set
- Defined in:
- lib/pokemon_tcg_sdk/set.rb
Instance Attribute Summary collapse
-
#id ⇒ Object
Returns the value of attribute id.
-
#images ⇒ Object
Returns the value of attribute images.
-
#legalities ⇒ Object
Returns the value of attribute legalities.
-
#name ⇒ Object
Returns the value of attribute name.
-
#printed_total ⇒ Object
Returns the value of attribute printed_total.
-
#ptcgo_code ⇒ Object
Returns the value of attribute ptcgo_code.
-
#release_date ⇒ Object
Returns the value of attribute release_date.
-
#series ⇒ Object
Returns the value of attribute series.
-
#total ⇒ Object
Returns the value of attribute total.
-
#updated_at ⇒ Object
Returns the value of attribute updated_at.
Class Method Summary collapse
-
.all ⇒ Array<Set>
Get all sets from a query by paging through data.
-
.find(id) ⇒ Set
Find a single set by the set code.
- .from_json(json) ⇒ Object
-
.Resource ⇒ String
Get the resource string.
-
.where(args) ⇒ Array<Set>
Adds a parameter to the hash of query parameters.
Instance Attribute Details
#id ⇒ Object
Returns the value of attribute id.
3 4 5 |
# File 'lib/pokemon_tcg_sdk/set.rb', line 3 def id @id end |
#images ⇒ Object
Returns the value of attribute images.
3 4 5 |
# File 'lib/pokemon_tcg_sdk/set.rb', line 3 def images @images end |
#legalities ⇒ Object
Returns the value of attribute legalities.
3 4 5 |
# File 'lib/pokemon_tcg_sdk/set.rb', line 3 def legalities @legalities end |
#name ⇒ Object
Returns the value of attribute name.
3 4 5 |
# File 'lib/pokemon_tcg_sdk/set.rb', line 3 def name @name end |
#printed_total ⇒ Object
Returns the value of attribute printed_total.
3 4 5 |
# File 'lib/pokemon_tcg_sdk/set.rb', line 3 def printed_total @printed_total end |
#ptcgo_code ⇒ Object
Returns the value of attribute ptcgo_code.
3 4 5 |
# File 'lib/pokemon_tcg_sdk/set.rb', line 3 def ptcgo_code @ptcgo_code end |
#release_date ⇒ Object
Returns the value of attribute release_date.
3 4 5 |
# File 'lib/pokemon_tcg_sdk/set.rb', line 3 def release_date @release_date end |
#series ⇒ Object
Returns the value of attribute series.
3 4 5 |
# File 'lib/pokemon_tcg_sdk/set.rb', line 3 def series @series end |
#total ⇒ Object
Returns the value of attribute total.
3 4 5 |
# File 'lib/pokemon_tcg_sdk/set.rb', line 3 def total @total end |
#updated_at ⇒ Object
Returns the value of attribute updated_at.
3 4 5 |
# File 'lib/pokemon_tcg_sdk/set.rb', line 3 def updated_at @updated_at end |
Class Method Details
.all ⇒ Array<Set>
Get all sets from a query by paging through data
39 40 41 |
# File 'lib/pokemon_tcg_sdk/set.rb', line 39 def self.all QueryBuilder.new(Set).all end |
.find(id) ⇒ Set
Find a single set by the set code
32 33 34 |
# File 'lib/pokemon_tcg_sdk/set.rb', line 32 def self.find(id) QueryBuilder.new(Set).find(id) end |
.from_json(json) ⇒ Object
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/pokemon_tcg_sdk/set.rb', line 5 def self.from_json(json) set = Set.new set.id = json['id'] set.name = json['name'] set.series = json['series'] set.printed_total = json['printedTotal'] set.total = json['total'] set.legalities = Legalities.from_json(json['legalities']) if !json['legalities'].nil? set.ptcgo_code = json['ptcgoCode'] set.release_date = json['releaseDate'] set.updated_at = json['updatedAt'] set.images = SetImages.from_json(json['images']) if !json['images'].nil? set end |
.Resource ⇒ String
Get the resource string
24 25 26 |
# File 'lib/pokemon_tcg_sdk/set.rb', line 24 def self.Resource "sets" end |
.where(args) ⇒ Array<Set>
Adds a parameter to the hash of query parameters
47 48 49 |
# File 'lib/pokemon_tcg_sdk/set.rb', line 47 def self.where(args) QueryBuilder.new(Set).where(args) end |