Class: DesignHuddle::User
- Inherits:
-
Object
- Object
- DesignHuddle::User
- Defined in:
- lib/design_huddle/user.rb
Instance Attribute Summary collapse
-
#account ⇒ Object
Returns the value of attribute account.
-
#account_user_id ⇒ Object
Returns the value of attribute account_user_id.
-
#date_created ⇒ Object
Returns the value of attribute date_created.
-
#date_updated ⇒ Object
Returns the value of attribute date_updated.
-
#email_address ⇒ Object
Returns the value of attribute email_address.
-
#first_name ⇒ Object
Returns the value of attribute first_name.
-
#last_activity ⇒ Object
Returns the value of attribute last_activity.
-
#last_name ⇒ Object
Returns the value of attribute last_name.
-
#project_count ⇒ Object
Returns the value of attribute project_count.
-
#test ⇒ Object
Returns the value of attribute test.
-
#user_code ⇒ Object
Returns the value of attribute user_code.
-
#user_id ⇒ Object
Returns the value of attribute user_id.
-
#user_properties ⇒ Object
Returns the value of attribute user_properties.
-
#user_roles ⇒ Object
Returns the value of attribute user_roles.
-
#user_status ⇒ Object
Returns the value of attribute user_status.
-
#user_type ⇒ Object
Returns the value of attribute user_type.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(user) ⇒ User
constructor
A new instance of User.
- #reload ⇒ Object
Constructor Details
#initialize(user) ⇒ User
Returns a new instance of User.
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/design_huddle/user.rb', line 6 def initialize(user) @user_id = user["user_id"] @account_user_id = user["account_user_id"] @user_code = user["user_code"] @test = user["test"] @email_address = user["email_address"] @first_name = user["first_name"] @last_name = user["last_name"] @user_properties = user["user_properties"] @date_created = user["date_created"] @date_updated = user["date_updated"] @last_activity = user["last_activity"] @project_count = user["project_count"] @account = user["account"] @user_roles = user["user_roles"] @user_status = user["user_status"] @user_type = user["user_type"] self end |
Instance Attribute Details
#account ⇒ Object
Returns the value of attribute account.
3 4 5 |
# File 'lib/design_huddle/user.rb', line 3 def account @account end |
#account_user_id ⇒ Object
Returns the value of attribute account_user_id.
3 4 5 |
# File 'lib/design_huddle/user.rb', line 3 def account_user_id @account_user_id end |
#date_created ⇒ Object
Returns the value of attribute date_created.
3 4 5 |
# File 'lib/design_huddle/user.rb', line 3 def date_created @date_created end |
#date_updated ⇒ Object
Returns the value of attribute date_updated.
3 4 5 |
# File 'lib/design_huddle/user.rb', line 3 def date_updated @date_updated end |
#email_address ⇒ Object
Returns the value of attribute email_address.
3 4 5 |
# File 'lib/design_huddle/user.rb', line 3 def email_address @email_address end |
#first_name ⇒ Object
Returns the value of attribute first_name.
3 4 5 |
# File 'lib/design_huddle/user.rb', line 3 def first_name @first_name end |
#last_activity ⇒ Object
Returns the value of attribute last_activity.
3 4 5 |
# File 'lib/design_huddle/user.rb', line 3 def last_activity @last_activity end |
#last_name ⇒ Object
Returns the value of attribute last_name.
3 4 5 |
# File 'lib/design_huddle/user.rb', line 3 def last_name @last_name end |
#project_count ⇒ Object
Returns the value of attribute project_count.
3 4 5 |
# File 'lib/design_huddle/user.rb', line 3 def project_count @project_count end |
#test ⇒ Object
Returns the value of attribute test.
3 4 5 |
# File 'lib/design_huddle/user.rb', line 3 def test @test end |
#user_code ⇒ Object
Returns the value of attribute user_code.
3 4 5 |
# File 'lib/design_huddle/user.rb', line 3 def user_code @user_code end |
#user_id ⇒ Object
Returns the value of attribute user_id.
3 4 5 |
# File 'lib/design_huddle/user.rb', line 3 def user_id @user_id end |
#user_properties ⇒ Object
Returns the value of attribute user_properties.
3 4 5 |
# File 'lib/design_huddle/user.rb', line 3 def user_properties @user_properties end |
#user_roles ⇒ Object
Returns the value of attribute user_roles.
3 4 5 |
# File 'lib/design_huddle/user.rb', line 3 def user_roles @user_roles end |
#user_status ⇒ Object
Returns the value of attribute user_status.
3 4 5 |
# File 'lib/design_huddle/user.rb', line 3 def user_status @user_status end |
#user_type ⇒ Object
Returns the value of attribute user_type.
3 4 5 |
# File 'lib/design_huddle/user.rb', line 3 def user_type @user_type end |
Class Method Details
.create(**args) ⇒ Object
30 31 32 33 34 35 36 |
# File 'lib/design_huddle/user.rb', line 30 def self.create(**args) DesignHuddle.client.call( method: :post, path: "/partners/api/account/users", payload: args.to_json ) end |
.fetch(user_id) ⇒ Object
46 47 48 |
# File 'lib/design_huddle/user.rb', line 46 def self.fetch(user_id) DesignHuddle.client.call(path: "/partners/api/account/users/#{user_id}")["data"] end |
.list ⇒ Object
38 39 40 |
# File 'lib/design_huddle/user.rb', line 38 def self.list DesignHuddle.client.call(path: "/partners/api/account/users")["data"]["items"].map { |user| User.new(user) } end |