Class: Komonjo::Model::User

Inherits:
Object
  • Object
show all
Includes:
Extension::ToJson
Defined in:
lib/komonjo/models/user.rb

Overview

slack user

Instance Attribute Summary collapse

Class Method Summary collapse

Methods included from Extension::ToJson

#to_json

Instance Attribute Details

#colorObject

Returns the value of attribute color.



7
8
9
# File 'lib/komonjo/models/user.rb', line 7

def color
  @color
end

#deletedObject

Returns the value of attribute deleted.



7
8
9
# File 'lib/komonjo/models/user.rb', line 7

def deleted
  @deleted
end

#has_2faObject

Returns the value of attribute has_2fa.



7
8
9
# File 'lib/komonjo/models/user.rb', line 7

def has_2fa
  @has_2fa
end

#has_filesObject

Returns the value of attribute has_files.



7
8
9
# File 'lib/komonjo/models/user.rb', line 7

def has_files
  @has_files
end

#idObject

Returns the value of attribute id.



7
8
9
# File 'lib/komonjo/models/user.rb', line 7

def id
  @id
end

#is_adminObject

Returns the value of attribute is_admin.



7
8
9
# File 'lib/komonjo/models/user.rb', line 7

def is_admin
  @is_admin
end

#is_ownerObject

Returns the value of attribute is_owner.



7
8
9
# File 'lib/komonjo/models/user.rb', line 7

def is_owner
  @is_owner
end

#is_primary_ownerObject

Returns the value of attribute is_primary_owner.



7
8
9
# File 'lib/komonjo/models/user.rb', line 7

def is_primary_owner
  @is_primary_owner
end

#is_restrictedObject

Returns the value of attribute is_restricted.



7
8
9
# File 'lib/komonjo/models/user.rb', line 7

def is_restricted
  @is_restricted
end

#is_ultra_restrictedObject

Returns the value of attribute is_ultra_restricted.



7
8
9
# File 'lib/komonjo/models/user.rb', line 7

def is_ultra_restricted
  @is_ultra_restricted
end

#nameObject

Returns the value of attribute name.



7
8
9
# File 'lib/komonjo/models/user.rb', line 7

def name
  @name
end

#profileObject

Returns the value of attribute profile.



7
8
9
# File 'lib/komonjo/models/user.rb', line 7

def profile
  @profile
end

Class Method Details

.create(hash) ⇒ Object



11
12
13
14
15
16
# File 'lib/komonjo/models/user.rb', line 11

def self.create(hash)
  new.tap do |e|
    hash.each { |k, v| e.instance_variable_set("@#{k}", v) }
    e.profile = Profile.create(hash[:profile]) if hash[:profile]
  end
end