Class: OpenStreetMap::User

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attrs = {}) ⇒ User

Returns a new instance of User.



25
26
27
28
29
30
31
# File 'lib/open_street_map/user.rb', line 25

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



11
12
13
# File 'lib/open_street_map/user.rb', line 11

def 
  @account_created
end

#descriptionObject

A little prosa about this user



14
15
16
# File 'lib/open_street_map/user.rb', line 14

def description
  @description
end

#display_nameObject (readonly)

Display name



8
9
10
# File 'lib/open_street_map/user.rb', line 8

def display_name
  @display_name
end

#idObject (readonly)

Unique ID



5
6
7
# File 'lib/open_street_map/user.rb', line 5

def id
  @id
end

#imgObject

A picture from this user



23
24
25
# File 'lib/open_street_map/user.rb', line 23

def img
  @img
end

#languagesObject

All languages the user can speak



17
18
19
# File 'lib/open_street_map/user.rb', line 17

def languages
  @languages
end

#latObject

Lat/Lon Coordinates of the users home.



20
21
22
# File 'lib/open_street_map/user.rb', line 20

def lat
  @lat
end

#lonObject

Lat/Lon Coordinates of the users home.



20
21
22
# File 'lib/open_street_map/user.rb', line 20

def lon
  @lon
end

#zoomObject

Lat/Lon Coordinates of the users home.



20
21
22
# File 'lib/open_street_map/user.rb', line 20

def zoom
  @zoom
end