Class: BoardGameGem::BGGUser

Inherits:
BGGBase
  • Object
show all
Defined in:
lib/bgg_user.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(xml) ⇒ BGGUser

Returns a new instance of BGGUser.



6
7
8
9
10
11
12
13
14
# File 'lib/bgg_user.rb', line 6

def initialize(xml)
  @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")
   = get_string(xml, "lastlogin", "value")
  @state = get_string(xml, "stateorprovince", "value")
  @trade_rating = get_integer(xml, "traderating", "value")
end

Instance Attribute Details

#avatarObject (readonly)

Returns the value of attribute avatar.



4
5
6
# File 'lib/bgg_user.rb', line 4

def avatar
  @avatar
end

#idObject (readonly)

Returns the value of attribute id.



4
5
6
# File 'lib/bgg_user.rb', line 4

def id
  @id
end

#last_loginObject (readonly)

Returns the value of attribute last_login.



4
5
6
# File 'lib/bgg_user.rb', line 4

def 
  
end

#nameObject (readonly)

Returns the value of attribute name.



4
5
6
# File 'lib/bgg_user.rb', line 4

def name
  @name
end

#stateObject (readonly)

Returns the value of attribute state.



4
5
6
# File 'lib/bgg_user.rb', line 4

def state
  @state
end

#trade_ratingObject (readonly)

Returns the value of attribute trade_rating.



4
5
6
# File 'lib/bgg_user.rb', line 4

def trade_rating
  @trade_rating
end

#year_registeredObject (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_collectionObject



16
17
18
# File 'lib/bgg_user.rb', line 16

def get_collection
  return BoardGameGem.get_collection(@name)
end