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(id: nil, email: nil, first_name: nil, last_name: nil, suspended: nil, tags: nil) ⇒ User
constructor
A new instance of User.
- #to_json(options = {}) ⇒ Object
Constructor Details
#initialize(id: nil, email: nil, first_name: nil, last_name: nil, suspended: nil, tags: nil) ⇒ User
Returns a new instance of User.
572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 |
# File 'lib/models/porcelain.rb', line 572 def initialize( id: nil, email: nil, first_name: nil, last_name: nil, suspended: nil, tags: nil ) if id != nil @id = id end if email != nil @email = email end if first_name != nil @first_name = first_name 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.
562 563 564 |
# File 'lib/models/porcelain.rb', line 562 def email @email end |
#first_name ⇒ Object
The User’s first name.
564 565 566 |
# File 'lib/models/porcelain.rb', line 564 def first_name @first_name end |
#id ⇒ Object
Unique identifier of the User.
560 561 562 |
# File 'lib/models/porcelain.rb', line 560 def id @id end |
#last_name ⇒ Object
The User’s last name.
566 567 568 |
# File 'lib/models/porcelain.rb', line 566 def last_name @last_name end |
#suspended ⇒ Object
The User’s suspended state.
568 569 570 |
# File 'lib/models/porcelain.rb', line 568 def suspended @suspended end |
#tags ⇒ Object
Tags is a map of key, value pairs.
570 571 572 |
# File 'lib/models/porcelain.rb', line 570 def @tags end |
Instance Method Details
#to_json(options = {}) ⇒ Object
600 601 602 603 604 605 606 |
# File 'lib/models/porcelain.rb', line 600 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 |