Class: Gonebusy::UpdateUserByIdResponse

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/gonebusy/models/update_user_by_id_response.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#to_hash, #to_json

Constructor Details

#initialize(user = nil) ⇒ UpdateUserByIdResponse

Returns a new instance of UpdateUserByIdResponse.



18
19
20
# File 'lib/gonebusy/models/update_user_by_id_response.rb', line 18

def initialize(user = nil)
  @user = user
end

Instance Attribute Details

#userEntitiesUserResponse

TODO: Write general description for this method



7
8
9
# File 'lib/gonebusy/models/update_user_by_id_response.rb', line 7

def user
  @user
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash



23
24
25
26
27
28
29
30
31
# File 'lib/gonebusy/models/update_user_by_id_response.rb', line 23

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash
  user = EntitiesUserResponse.from_hash(hash['user']) if hash['user']

  # Create object from extracted values
  UpdateUserByIdResponse.new(user)
end

.namesObject

A mapping from model property names to API property names



10
11
12
13
14
15
16
# File 'lib/gonebusy/models/update_user_by_id_response.rb', line 10

def self.names
  if @_hash.nil?
    @_hash = {}
    @_hash["user"] = "user"
  end
  @_hash
end