Class: Vermonster::Users::User

Inherits:
Hash
  • Object
show all
Defined in:
lib/vermonster/users.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ User

Returns a new instance of User.



12
13
14
15
16
17
18
19
# File 'lib/vermonster/users.rb', line 12

def initialize(options = {})
  self.merge!(options)

  options.each do |(attr, val)|      
    instance_variable_set("@#{attr}", val)
    instance_eval "def #{attr}() @#{attr} end"
  end
end

Class Method Details

.meObject



21
22
23
# File 'lib/vermonster/users.rb', line 21

def self.me
  User.new(Vermonster::Client.connection.get("me").body)
end