Class: AuctionFunCore::Entities::User
- Inherits:
-
ROM::Struct
- Object
- ROM::Struct
- AuctionFunCore::Entities::User
- Defined in:
- lib/auction_fun_core/entities/user.rb
Overview
Defines the User class as Entity. It appears to be a simple data structure class representing user-related information.
Instance Method Summary collapse
-
#active? ⇒ Boolean
Checks if the user is active.
-
#balance ⇒ Money
Returns the user’s balance as a Money object.
-
#confirmed? ⇒ Boolean
Checks if the user has been confirmed.
-
#email_confirmed? ⇒ Boolean
Checks if the user’s email has been confirmed.
-
#inactive? ⇒ Boolean
Checks if the user is inactive.
-
#info ⇒ Hash
Returns user information excluding password digest.
-
#phone_confirmed? ⇒ Boolean
Checks if the user’s phone has been confirmed.
Instance Method Details
#active? ⇒ Boolean
Checks if the user is active.
13 14 15 |
# File 'lib/auction_fun_core/entities/user.rb', line 13 def active? active end |
#balance ⇒ Money
Returns the user’s balance as a Money object.
61 62 63 |
# File 'lib/auction_fun_core/entities/user.rb', line 61 def balance Money.new(balance_cents, balance_currency) end |
#confirmed? ⇒ Boolean
Checks if the user has been confirmed.
29 30 31 |
# File 'lib/auction_fun_core/entities/user.rb', line 29 def confirmed? confirmed_at.present? end |
#email_confirmed? ⇒ Boolean
Checks if the user’s email has been confirmed.
37 38 39 |
# File 'lib/auction_fun_core/entities/user.rb', line 37 def email_confirmed? email_confirmation_at.present? end |
#inactive? ⇒ Boolean
Checks if the user is inactive.
21 22 23 |
# File 'lib/auction_fun_core/entities/user.rb', line 21 def inactive? !active end |
#info ⇒ Hash
Returns user information excluding password digest.
53 54 55 |
# File 'lib/auction_fun_core/entities/user.rb', line 53 def info attributes.except(:password_digest) end |
#phone_confirmed? ⇒ Boolean
Checks if the user’s phone has been confirmed.
45 46 47 |
# File 'lib/auction_fun_core/entities/user.rb', line 45 def phone_confirmed? phone_confirmation_at.present? end |