Class: Misty::Auth::Name
- Inherits:
-
Struct
- Object
- Struct
- Misty::Auth::Name
- Defined in:
- lib/misty/auth/name.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#id ⇒ Object
Returns the value of attribute id.
-
#name ⇒ Object
Returns the value of attribute name.
Instance Method Summary collapse
Instance Attribute Details
#id ⇒ Object
Returns the value of attribute id
20 21 22 |
# File 'lib/misty/auth/name.rb', line 20 def id @id end |
#name ⇒ Object
Returns the value of attribute name
20 21 22 |
# File 'lib/misty/auth/name.rb', line 20 def name @name end |
Instance Method Details
#identity ⇒ Object
21 22 23 24 25 |
# File 'lib/misty/auth/name.rb', line 21 def identity return to_h(:id) unless id.nil? return to_h(:name) unless name.nil? raise Misty::Config::CredentialsError, "#{self.class}: No available id or name" end |
#to_h(var) ⇒ Object
27 28 29 |
# File 'lib/misty/auth/name.rb', line 27 def to_h(var) { var => self.send(var) } end |