Class: C2eCore::Drops::UserDrop

Inherits:
BaseDrop
  • Object
show all
Defined in:
/build/app/mailers/c2e_core/drops/user_drop.rb

Instance Method Summary collapse

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_urlString

Returns - Link to create or change administrator password for user.

Returns:

  • (String)
    • 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_soonC2eCore::Drops::CreditsExpiringSoonDrop?

Returns - First credits that are expiring soon as drop object or nil if none present.

Returns:



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_nameString

Returns - First name of user.

Returns:

  • (String)
    • 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_nameString

Returns - Concatenation of first and last name of user.

Returns:

  • (String)
    • 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_nameString

Returns - Last name of user.

Returns:

  • (String)
    • 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

#loginString

Returns - Login of user.

Returns:

  • (String)
    • Login of user.



32
33
34
# File '/build/app/mailers/c2e_core/drops/user_drop.rb', line 32

def 
  @user.
end

#user_nameString

Returns - Login of user.

Returns:

  • (String)
    • Login of user.



27
28
29
# File '/build/app/mailers/c2e_core/drops/user_drop.rb', line 27

def user_name
  
end