Class: Rosemary::User

Inherits:
Object
  • Object
show all
Defined in:
lib/rosemary/user.rb

Overview

The user object representing a registered OSM user.

Instance Attribute Summary collapse

Instance Method Summary collapse

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_createdObject (readonly)

When this user was created



12
13
14
# File 'lib/rosemary/user.rb', line 12

def 
  @account_created
end

#descriptionObject

A little prosa about this user



15
16
17
# File 'lib/rosemary/user.rb', line 15

def description
  @description
end

#display_nameObject (readonly)

Display name



9
10
11
# File 'lib/rosemary/user.rb', line 9

def display_name
  @display_name
end

#idObject (readonly)

Unique ID



6
7
8
# File 'lib/rosemary/user.rb', line 6

def id
  @id
end

#imgObject

A picture from this user



24
25
26
# File 'lib/rosemary/user.rb', line 24

def img
  @img
end

#languagesObject

All languages the user can speak



18
19
20
# File 'lib/rosemary/user.rb', line 18

def languages
  @languages
end

#latObject

Lat/Lon Coordinates of the users home.



21
22
23
# File 'lib/rosemary/user.rb', line 21

def lat
  @lat
end

#lonObject

Lat/Lon Coordinates of the users home.



21
22
23
# File 'lib/rosemary/user.rb', line 21

def lon
  @lon
end

#zoomObject

Lat/Lon Coordinates of the users home.



21
22
23
# File 'lib/rosemary/user.rb', line 21

def zoom
  @zoom
end