Class: SDM::User
- Inherits:
-
Object
- Object
- SDM::User
- Defined in:
- lib/models/porcelain.rb
Overview
A User can connect to resources they are granted directly, or granted via roles.
Instance Attribute Summary collapse
-
#email ⇒ Object
The User's email address.
-
#first_name ⇒ Object
The User's first name.
-
#id ⇒ Object
Unique identifier of the User.
-
#last_name ⇒ Object
The User's last name.
-
#suspended ⇒ Object
The User's suspended state.
-
#tags ⇒ Object
Tags is a map of key, value pairs.
Instance Method Summary collapse
-
#initialize(email: nil, first_name: nil, id: nil, last_name: nil, suspended: nil, tags: nil) ⇒ User
constructor
A new instance of User.
- #to_json(options = {}) ⇒ Object
Constructor Details
#initialize(email: nil, first_name: nil, id: nil, last_name: nil, suspended: nil, tags: nil) ⇒ User
Returns a new instance of User.
7599 7600 7601 7602 7603 7604 7605 7606 7607 7608 7609 7610 7611 7612 7613 7614 7615 7616 7617 7618 7619 7620 7621 7622 7623 7624 7625 |
# File 'lib/models/porcelain.rb', line 7599 def initialize( email: nil, first_name: nil, id: nil, last_name: nil, suspended: nil, tags: nil ) if email != nil @email = email end if first_name != nil @first_name = first_name end if id != nil @id = id end if last_name != nil @last_name = last_name end if suspended != nil @suspended = suspended end if != nil @tags = end end |
Instance Attribute Details
#email ⇒ Object
The User's email address. Must be unique.
7587 7588 7589 |
# File 'lib/models/porcelain.rb', line 7587 def email @email end |
#first_name ⇒ Object
The User's first name.
7589 7590 7591 |
# File 'lib/models/porcelain.rb', line 7589 def first_name @first_name end |
#id ⇒ Object
Unique identifier of the User.
7591 7592 7593 |
# File 'lib/models/porcelain.rb', line 7591 def id @id end |
#last_name ⇒ Object
The User's last name.
7593 7594 7595 |
# File 'lib/models/porcelain.rb', line 7593 def last_name @last_name end |
#suspended ⇒ Object
The User's suspended state.
7595 7596 7597 |
# File 'lib/models/porcelain.rb', line 7595 def suspended @suspended end |
#tags ⇒ Object
Tags is a map of key, value pairs.
7597 7598 7599 |
# File 'lib/models/porcelain.rb', line 7597 def @tags end |
Instance Method Details
#to_json(options = {}) ⇒ Object
7627 7628 7629 7630 7631 7632 7633 |
# File 'lib/models/porcelain.rb', line 7627 def to_json( = {}) hash = {} self.instance_variables.each do |var| hash[var.id2name.delete_prefix("@")] = self.instance_variable_get var end hash.to_json end |