lib/bnet/diablo3/skill.rb in bnet-0.0.3 vs lib/bnet/diablo3/skill.rb in bnet-0.0.4
- old
+ new
@@ -9,11 +9,15 @@
# "rune" => { name: "", ... }
# }
#
# Returns:
#
- # #<Bnet::Diablo3::Skill:0x007fd111396360 @name: "", @rune=>
+ # #<Bnet::Diablo3::Skill:0x007fd111396360 @name: "", @rune: "">
def self.from_api(response)
- new(name: response['skill']['name'], rune: response['rune']['name'])
+ skill = new
+ skill.name = response['skill']['name']
+ skill.rune = response['rune']['name'] if response["rune"]
+
+ return skill
end
end