Class: BoardGameGem::BGGSearchResult
- Defined in:
- lib/bgg_search_result.rb
Instance Attribute Summary collapse
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
-
#year_published ⇒ Object
readonly
Returns the value of attribute year_published.
Instance Method Summary collapse
-
#initialize(xml) ⇒ BGGSearchResult
constructor
A new instance of BGGSearchResult.
- #to_item(statistics = false) ⇒ Object
Constructor Details
#initialize(xml) ⇒ BGGSearchResult
Returns a new instance of BGGSearchResult.
6 7 8 9 10 11 |
# File 'lib/bgg_search_result.rb', line 6 def initialize(xml) @id = xml["id"].to_i @type = xml["type"] @name = get_string(xml, "name", "value") @year_published = get_string(xml, "yearpublished", "value") end |
Instance Attribute Details
#id ⇒ Object (readonly)
Returns the value of attribute id.
4 5 6 |
# File 'lib/bgg_search_result.rb', line 4 def id @id end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
4 5 6 |
# File 'lib/bgg_search_result.rb', line 4 def name @name end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
4 5 6 |
# File 'lib/bgg_search_result.rb', line 4 def type @type end |
#year_published ⇒ Object (readonly)
Returns the value of attribute year_published.
4 5 6 |
# File 'lib/bgg_search_result.rb', line 4 def year_published @year_published end |
Instance Method Details
#to_item(statistics = false) ⇒ Object
13 14 15 |
# File 'lib/bgg_search_result.rb', line 13 def to_item(statistics = false) return BoardGameGem.get_item(@id, statistics) end |