Class: C2eCore::Drops::UserDrop
- Defined in:
- /build/app/mailers/c2e_core/drops/user_drop.rb
Instance Method Summary collapse
-
#admin_app_url ⇒ String
-
Link to create or change administrator password for user.
-
-
#credits_expiring_soon ⇒ C2eCore::Drops::CreditsExpiringSoonDrop?
-
First credits that are expiring soon as drop object or nil if none present.
-
-
#first_name ⇒ String
-
First name of user.
-
-
#full_name ⇒ String
-
Concatenation of first and last name of user.
-
-
#initialize(user) ⇒ UserDrop
constructor
A new instance of UserDrop.
-
#last_name ⇒ String
-
Last name of user.
-
-
#login ⇒ String
-
Login of user.
-
-
#user_name ⇒ String
-
Login of user.
-
Constructor Details
#initialize(user) ⇒ UserDrop
Returns a new instance of UserDrop.
6 7 8 9 |
# File '/build/app/mailers/c2e_core/drops/user_drop.rb', line 6 def initialize(user) super() @user = user end |
Instance Method Details
#admin_app_url ⇒ String
Returns - Link to create or change administrator password for user.
37 38 39 |
# File '/build/app/mailers/c2e_core/drops/user_drop.rb', line 37 def admin_app_url C2eCore::Services::ResetPasswordUrl.call(user: @user) end |
#credits_expiring_soon ⇒ C2eCore::Drops::CreditsExpiringSoonDrop?
Returns - First credits that are expiring soon as drop object or nil if none present.
43 44 45 46 47 48 |
# File '/build/app/mailers/c2e_core/drops/user_drop.rb', line 43 def credits_expiring_soon first_to_expire = @user.credits_expiring_soon.order(:expires_at).first return if first_to_expire.nil? CreditsExpiringSoonDrop.new(first_to_expire) end |
#first_name ⇒ String
Returns - First name of user.
12 13 14 |
# File '/build/app/mailers/c2e_core/drops/user_drop.rb', line 12 def first_name @user.first_name end |
#full_name ⇒ String
Returns - Concatenation of first and last name of user.
22 23 24 |
# File '/build/app/mailers/c2e_core/drops/user_drop.rb', line 22 def full_name @user.full_name end |
#last_name ⇒ String
Returns - Last name of user.
17 18 19 |
# File '/build/app/mailers/c2e_core/drops/user_drop.rb', line 17 def last_name @user.last_name end |
#login ⇒ String
Returns - Login of user.
32 33 34 |
# File '/build/app/mailers/c2e_core/drops/user_drop.rb', line 32 def login @user.login end |
#user_name ⇒ String
Returns - Login of user.
27 28 29 |
# File '/build/app/mailers/c2e_core/drops/user_drop.rb', line 27 def user_name login end |