Class: Rosemary::User
- Inherits:
-
Object
- Object
- Rosemary::User
- Defined in:
- lib/rosemary/user.rb
Overview
The user object representing a registered OSM user.
Instance Attribute Summary collapse
-
#account_created ⇒ Object
readonly
When this user was created.
-
#description ⇒ Object
A little prosa about this user.
-
#display_name ⇒ Object
readonly
Display name.
-
#id ⇒ Object
readonly
Unique ID.
-
#img ⇒ Object
A picture from this user.
-
#languages ⇒ Object
All languages the user can speak.
-
#lat ⇒ Object
Lat/Lon Coordinates of the users home.
-
#lon ⇒ Object
Lat/Lon Coordinates of the users home.
-
#zoom ⇒ Object
Lat/Lon Coordinates of the users home.
Instance Method Summary collapse
-
#initialize(attrs = {}) ⇒ User
constructor
A new instance of User.
Constructor Details
#initialize(attrs = {}) ⇒ User
Returns a new instance of User.
26 27 28 29 30 31 32 |
# File 'lib/rosemary/user.rb', line 26 def initialize(attrs = {}) attrs.stringify_keys! @id = attrs['id'].to_i if attrs['id'] @display_name = attrs['display_name'] @account_created = Time.parse(attrs['account_created']) rescue nil @languages = [] end |
Instance Attribute Details
#account_created ⇒ Object (readonly)
When this user was created
12 13 14 |
# File 'lib/rosemary/user.rb', line 12 def account_created @account_created end |
#description ⇒ Object
A little prosa about this user
15 16 17 |
# File 'lib/rosemary/user.rb', line 15 def description @description end |
#display_name ⇒ Object (readonly)
Display name
9 10 11 |
# File 'lib/rosemary/user.rb', line 9 def display_name @display_name end |
#id ⇒ Object (readonly)
Unique ID
6 7 8 |
# File 'lib/rosemary/user.rb', line 6 def id @id end |
#img ⇒ Object
A picture from this user
24 25 26 |
# File 'lib/rosemary/user.rb', line 24 def img @img end |
#languages ⇒ Object
All languages the user can speak
18 19 20 |
# File 'lib/rosemary/user.rb', line 18 def languages @languages end |
#lat ⇒ Object
Lat/Lon Coordinates of the users home.
21 22 23 |
# File 'lib/rosemary/user.rb', line 21 def lat @lat end |
#lon ⇒ Object
Lat/Lon Coordinates of the users home.
21 22 23 |
# File 'lib/rosemary/user.rb', line 21 def lon @lon end |
#zoom ⇒ Object
Lat/Lon Coordinates of the users home.
21 22 23 |
# File 'lib/rosemary/user.rb', line 21 def zoom @zoom end |