Class: Sensr::User

Inherits:
SensrObject show all
Defined in:
lib/sensr/user.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from SensrObject

#attributes, #attributes=, #id, #method_missing

Constructor Details

#initialize(hash) ⇒ User

:nodoc:



10
11
12
13
14
# File 'lib/sensr/user.rb', line 10

def initialize(hash) # :nodoc:
  new_hash = hash["user"]
  new_hash["urls"] = hash["urls"]
  super(new_hash)
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Sensr::SensrObject

Class Method Details

.meObject

Get the current user



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

def self.me
  response = Sensr.request(:get, Sensr.api_base_url + '/users/me', nil)
  User.new(response)
end