Class: DocFox::User::Facade
- Inherits:
-
Object
- Object
- DocFox::User::Facade
- Defined in:
- lib/doc_fox/user/facade.rb
Instance Attribute Summary collapse
-
#attributes ⇒ Object
readonly
Returns the value of attribute attributes.
-
#deactivated ⇒ Object
readonly
Returns the value of attribute deactivated.
-
#deactivation_date ⇒ Object
readonly
Returns the value of attribute deactivation_date.
-
#email ⇒ Object
readonly
Returns the value of attribute email.
-
#first_names ⇒ Object
readonly
Returns the value of attribute first_names.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#last_names ⇒ Object
readonly
Returns the value of attribute last_names.
Instance Method Summary collapse
-
#initialize(hash) ⇒ Facade
constructor
A new instance of Facade.
Constructor Details
#initialize(hash) ⇒ Facade
Returns a new instance of Facade.
6 7 8 9 10 11 12 13 14 15 |
# File 'lib/doc_fox/user/facade.rb', line 6 def initialize(hash) @id = hash.dig('data', 'id') || hash['id'] @attributes = hash.dig('data', 'attributes') || hash['attributes'] @deactivated = attributes['deactivated'] @deactivation_date = attributes['deactivation_date'] @email = attributes['email'] @first_names = attributes['first_names'] @last_names = attributes['last_names'] end |
Instance Attribute Details
#attributes ⇒ Object (readonly)
Returns the value of attribute attributes.
4 5 6 |
# File 'lib/doc_fox/user/facade.rb', line 4 def attributes @attributes end |
#deactivated ⇒ Object (readonly)
Returns the value of attribute deactivated.
4 5 6 |
# File 'lib/doc_fox/user/facade.rb', line 4 def deactivated @deactivated end |
#deactivation_date ⇒ Object (readonly)
Returns the value of attribute deactivation_date.
4 5 6 |
# File 'lib/doc_fox/user/facade.rb', line 4 def deactivation_date @deactivation_date end |
#email ⇒ Object (readonly)
Returns the value of attribute email.
4 5 6 |
# File 'lib/doc_fox/user/facade.rb', line 4 def email @email end |
#first_names ⇒ Object (readonly)
Returns the value of attribute first_names.
4 5 6 |
# File 'lib/doc_fox/user/facade.rb', line 4 def first_names @first_names end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
4 5 6 |
# File 'lib/doc_fox/user/facade.rb', line 4 def id @id end |
#last_names ⇒ Object (readonly)
Returns the value of attribute last_names.
4 5 6 |
# File 'lib/doc_fox/user/facade.rb', line 4 def last_names @last_names end |