Class: Pokemon::TcgPlayerPrices

Inherits:
Object
  • Object
show all
Defined in:
lib/pokemon_tcg_sdk/tcgplayer.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Attribute Details

#first_editionObject

Returns the value of attribute first_edition.



16
17
18
# File 'lib/pokemon_tcg_sdk/tcgplayer.rb', line 16

def first_edition
  @first_edition
end

#first_edition_holofoilObject

Returns the value of attribute first_edition_holofoil.



16
17
18
# File 'lib/pokemon_tcg_sdk/tcgplayer.rb', line 16

def first_edition_holofoil
  @first_edition_holofoil
end

#first_edition_normalObject

Returns the value of attribute first_edition_normal.



16
17
18
# File 'lib/pokemon_tcg_sdk/tcgplayer.rb', line 16

def first_edition_normal
  @first_edition_normal
end

#holofoilObject

Returns the value of attribute holofoil.



16
17
18
# File 'lib/pokemon_tcg_sdk/tcgplayer.rb', line 16

def holofoil
  @holofoil
end

#normalObject

Returns the value of attribute normal.



16
17
18
# File 'lib/pokemon_tcg_sdk/tcgplayer.rb', line 16

def normal
  @normal
end

#reverse_holofoilObject

Returns the value of attribute reverse_holofoil.



16
17
18
# File 'lib/pokemon_tcg_sdk/tcgplayer.rb', line 16

def reverse_holofoil
  @reverse_holofoil
end

#unlimitedObject

Returns the value of attribute unlimited.



16
17
18
# File 'lib/pokemon_tcg_sdk/tcgplayer.rb', line 16

def unlimited
  @unlimited
end

Class Method Details

.from_json(json) ⇒ Object



18
19
20
21
22
23
24
25
26
27
28
29
# File 'lib/pokemon_tcg_sdk/tcgplayer.rb', line 18

def self.from_json(json)
  price = TcgPlayerPrices.new
  price.normal = TcgPlayerPriceValues.from_json(json['normal']) if json.key? 'normal'
  price.holofoil = TcgPlayerPriceValues.from_json(json['holofoil']) if !json['holofoil'].nil?
  price.reverse_holofoil = TcgPlayerPriceValues.from_json(json['reverseHolofoil']) if !json['reverseHolofoil'].nil?
  price.first_edition_holofoil = TcgPlayerPriceValues.from_json(json['1stEditionHolofoil']) if !json['1stEditionHolofoil'].nil?
  price.first_edition_normal = TcgPlayerPriceValues.from_json(json['1stEditionNormal']) if !json['1stEditionNormal'].nil?
  price.first_edition = TcgPlayerPriceValues.from_json(json['1stEdition']) if !json['1stEdition'].nil?
  price.unlimited = TcgPlayerPriceValues.from_json(json['unlimited']) if !json['unlimited'].nil?

  price
end