Class: Leash::User
- Inherits:
-
Object
- Object
- Leash::User
- Defined in:
- lib/leash/auth.rb
Overview
Simple value object representing an authenticated Leash user.
Instance Attribute Summary collapse
-
#email ⇒ Object
readonly
Returns the value of attribute email.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#picture ⇒ Object
readonly
Returns the value of attribute picture.
Instance Method Summary collapse
- #==(other) ⇒ Object
-
#initialize(id:, email:, name: nil, picture: nil) ⇒ User
constructor
A new instance of User.
Constructor Details
#initialize(id:, email:, name: nil, picture: nil) ⇒ User
Returns a new instance of User.
22 23 24 25 26 27 |
# File 'lib/leash/auth.rb', line 22 def initialize(id:, email:, name: nil, picture: nil) @id = id @email = email @name = name @picture = picture end |
Instance Attribute Details
#email ⇒ Object (readonly)
Returns the value of attribute email.
16 17 18 |
# File 'lib/leash/auth.rb', line 16 def email @email end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
16 17 18 |
# File 'lib/leash/auth.rb', line 16 def id @id end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
16 17 18 |
# File 'lib/leash/auth.rb', line 16 def name @name end |
#picture ⇒ Object (readonly)
Returns the value of attribute picture.
16 17 18 |
# File 'lib/leash/auth.rb', line 16 def picture @picture end |
Instance Method Details
#==(other) ⇒ Object
29 30 31 32 33 34 35 |
# File 'lib/leash/auth.rb', line 29 def ==(other) other.is_a?(User) && id == other.id && email == other.email && name == other.name && picture == other.picture end |