Class: Pokemon::Ability

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

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Attribute Details

#nameObject

Returns the value of attribute name.



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

def name
  @name
end

#textObject

Returns the value of attribute text.



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

def text
  @text
end

#typeObject

Returns the value of attribute type.



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

def type
  @type
end

Class Method Details

.from_json(json) ⇒ Object



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

def self.from_json(json)
  ability = Ability.new
  ability.name = json['name']
  ability.text = json['text']
  ability.type = json['type']

  ability
end