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.
Instance Method Summary collapse
-
#initialize(id: nil, email: nil, first_name: nil, last_name: nil, suspended: 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) ⇒ User
Returns a new instance of User.
547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 |
# File 'lib/models/porcelain.rb', line 547 def initialize( id:nil \ , email:nil \ , first_name:nil \ , last_name:nil \ , suspended: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 end |
Instance Attribute Details
#email ⇒ Object
The User’s email address. Must be unique.
540 541 542 |
# File 'lib/models/porcelain.rb', line 540 def email @email end |
#first_name ⇒ Object
The User’s first name.
542 543 544 |
# File 'lib/models/porcelain.rb', line 542 def first_name @first_name end |
#id ⇒ Object
Unique identifier of the User.
538 539 540 |
# File 'lib/models/porcelain.rb', line 538 def id @id end |
#last_name ⇒ Object
The User’s last name.
544 545 546 |
# File 'lib/models/porcelain.rb', line 544 def last_name @last_name end |
#suspended ⇒ Object
The User’s suspended state.
546 547 548 |
# File 'lib/models/porcelain.rb', line 546 def suspended @suspended end |
Instance Method Details
#to_json(options = {}) ⇒ Object
574 575 576 577 578 579 580 |
# File 'lib/models/porcelain.rb', line 574 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 |