Class: IGE_ISB_API::Games
- Inherits:
-
Object
- Object
- IGE_ISB_API::Games
- Defined in:
- lib/ige_isb_api/games.rb
Instance Attribute Summary collapse
-
#categories ⇒ Object
Returns the value of attribute categories.
-
#images ⇒ Object
Returns the value of attribute images.
Instance Method Summary collapse
-
#initialize ⇒ Games
constructor
A new instance of Games.
- #load_from_xml(the_xml, language = IGE_ISB_API::Constants::DEFAULT_LANGUAGE) ⇒ Object
Constructor Details
#initialize ⇒ Games
Returns a new instance of Games.
421 422 423 424 |
# File 'lib/ige_isb_api/games.rb', line 421 def initialize() @categories = [] @games = [] end |
Instance Attribute Details
#categories ⇒ Object
Returns the value of attribute categories.
419 420 421 |
# File 'lib/ige_isb_api/games.rb', line 419 def categories @categories end |
#images ⇒ Object
Returns the value of attribute images.
419 420 421 |
# File 'lib/ige_isb_api/games.rb', line 419 def images @images end |
Instance Method Details
#load_from_xml(the_xml, language = IGE_ISB_API::Constants::DEFAULT_LANGUAGE) ⇒ Object
426 427 428 429 430 431 432 |
# File 'lib/ige_isb_api/games.rb', line 426 def load_from_xml(the_xml, language = IGE_ISB_API::Constants::DEFAULT_LANGUAGE) doc = Nokogiri::XML(the_xml) @images = doc.xpath("//images").first['url'] doc.xpath("//games/c").each do |cat_node| @categories << Category.from_node(cat_node, language: language) end end |