Class: BoardGameGem::BGGUser
Instance Attribute Summary collapse
-
#avatar ⇒ Object
readonly
Returns the value of attribute avatar.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#last_login ⇒ Object
readonly
Returns the value of attribute last_login.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#state ⇒ Object
readonly
Returns the value of attribute state.
-
#trade_rating ⇒ Object
readonly
Returns the value of attribute trade_rating.
-
#year_registered ⇒ Object
readonly
Returns the value of attribute year_registered.
Instance Method Summary collapse
- #get_collection ⇒ Object
-
#initialize(xml) ⇒ BGGUser
constructor
A new instance of BGGUser.
Constructor Details
#initialize(xml) ⇒ BGGUser
Returns a new instance of BGGUser.
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/bgg_user.rb', line 6 def initialize(xml) if !xml.nil? @id = get_integer(xml, "user", "id") @name = get_string(xml, "user", "name") @avatar = get_string(xml, "avatarlink", "value") @year_registered = get_integer(xml, "yearregistered", "value") @last_login = get_string(xml, "lastlogin", "value") @state = get_string(xml, "stateorprovince", "value") @trade_rating = get_integer(xml, "traderating", "value") else @id = -1 @name = "" @avatar = "" @year_registered = -1 @last_login = "0000-00-00 00:00:00" @state = "" @trade_rating = -1 end end |
Instance Attribute Details
#avatar ⇒ Object (readonly)
Returns the value of attribute avatar.
4 5 6 |
# File 'lib/bgg_user.rb', line 4 def avatar @avatar end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
4 5 6 |
# File 'lib/bgg_user.rb', line 4 def id @id end |
#last_login ⇒ Object (readonly)
Returns the value of attribute last_login.
4 5 6 |
# File 'lib/bgg_user.rb', line 4 def last_login @last_login end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
4 5 6 |
# File 'lib/bgg_user.rb', line 4 def name @name end |
#state ⇒ Object (readonly)
Returns the value of attribute state.
4 5 6 |
# File 'lib/bgg_user.rb', line 4 def state @state end |
#trade_rating ⇒ Object (readonly)
Returns the value of attribute trade_rating.
4 5 6 |
# File 'lib/bgg_user.rb', line 4 def @trade_rating end |
#year_registered ⇒ Object (readonly)
Returns the value of attribute year_registered.
4 5 6 |
# File 'lib/bgg_user.rb', line 4 def year_registered @year_registered end |
Instance Method Details
#get_collection ⇒ Object
26 27 28 |
# File 'lib/bgg_user.rb', line 26 def get_collection return BoardGameGem.get_collection(@name) end |