Class: Pokemon::Weakness

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

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Attribute Details

#typeObject

Returns the value of attribute type.



3
4
5
# File 'lib/pokemon_tcg_sdk/weakness.rb', line 3

def type
  @type
end

#valueObject

Returns the value of attribute value.



3
4
5
# File 'lib/pokemon_tcg_sdk/weakness.rb', line 3

def value
  @value
end

Class Method Details

.from_json(json) ⇒ Object



5
6
7
8
9
10
11
# File 'lib/pokemon_tcg_sdk/weakness.rb', line 5

def self.from_json(json)
  weakness = Weakness.new
  weakness.type = json['type']
  weakness.value = json['value']

  weakness
end