Class: SemaphoreClient::Model::User

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

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#created_atObject (readonly)

Returns the value of attribute created_at.



4
5
6
# File 'lib/semaphore_client/model/user.rb', line 4

def created_at
  @created_at
end

#nameObject (readonly)

Returns the value of attribute name.



4
5
6
# File 'lib/semaphore_client/model/user.rb', line 4

def name
  @name
end

#uidObject (readonly)

Returns the value of attribute uid.



4
5
6
# File 'lib/semaphore_client/model/user.rb', line 4

def uid
  @uid
end

#updated_atObject (readonly)

Returns the value of attribute updated_at.



4
5
6
# File 'lib/semaphore_client/model/user.rb', line 4

def updated_at
  @updated_at
end

#usernameObject (readonly)

Returns the value of attribute username.



4
5
6
# File 'lib/semaphore_client/model/user.rb', line 4

def username
  @username
end

Class Method Details

.create(attributes) ⇒ Object



10
11
12
# File 'lib/semaphore_client/model/user.rb', line 10

def self.create(attributes)
  new.update(attributes)
end

.load(attributes) ⇒ Object



6
7
8
# File 'lib/semaphore_client/model/user.rb', line 6

def self.load(attributes)
  new.load(attributes)
end

Instance Method Details

#load(attributes) ⇒ Object



14
15
16
17
18
19
20
21
22
23
24
# File 'lib/semaphore_client/model/user.rb', line 14

def load(attributes)
  attributes = symbolize_keys(attributes)

  @uid = attributes[:uid] if attributes.key?(:uid)
  @username = attributes[:username] if attributes.key?(:username)
  @name = attributes[:name] if attributes.key?(:name)
  @created_at = attributes[:created_at] if attributes.key?(:created_at)
  @updated_at = attributes[:updated_at] if attributes.key?(:updated_at)

  self
end

#serializeObject



30
31
32
# File 'lib/semaphore_client/model/user.rb', line 30

def serialize
  {}
end

#update(attributes) ⇒ Object



26
27
28
# File 'lib/semaphore_client/model/user.rb', line 26

def update(attributes)
  self
end