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
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

#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 
  @last_login
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



26
27
28
# File 'lib/bgg_user.rb', line 26

def get_collection
	return BoardGameGem.get_collection(@name)
end