Sha256: d952273e3eacde2cf2bd4daa38f302cfef90d6eb0f46006e4c52835fba1bec7a

Contents?: true

Size: 820 Bytes

Versions: 13

Compression:

Stored size: 820 Bytes

Contents

require 'builder'
module Rosemary
  # The user object representing a registered OSM user.
  class User
    # Unique ID
    attr_reader :id

    # Display name
    attr_reader :display_name

    # When this user was created
    attr_reader :account_created

    # A little prosa about this user
    attr_accessor :description

    # All languages the user can speak
    attr_accessor :languages

    # Lat/Lon Coordinates of the users home.
    attr_accessor :lat, :lon, :zoom

    # A picture from this user
    attr_accessor :img

    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

  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
rosemary-0.4.4 lib/rosemary/user.rb
rosemary-0.4.3 lib/rosemary/user.rb
rosemary-0.4.2 lib/rosemary/user.rb
rosemary-0.4.1 lib/rosemary/user.rb
rosemary-0.4.0 lib/rosemary/user.rb
rosemary-0.3.12 lib/rosemary/user.rb
rosemary-0.3.11 lib/rosemary/user.rb
rosemary-0.3.10 lib/rosemary/user.rb
rosemary-0.3.9 lib/rosemary/user.rb
rosemary-0.3.8 lib/rosemary/user.rb
rosemary-0.3.7 lib/rosemary/user.rb
rosemary-0.3.6 lib/rosemary/user.rb
rosemary-0.3.5 lib/rosemary/user.rb