Class: C2eCore::Drops::CreditsGroupDrop

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

Instance Method Summary collapse

Constructor Details

#initialize(group) ⇒ CreditsGroupDrop

Returns a new instance of CreditsGroupDrop.



6
7
8
9
# File '/build/app/mailers/c2e_core/drops/credits_group_drop.rb', line 6

def initialize(group)
  super()
  @group = group
end

Instance Method Details

#cashless_refund_fromString

Returns - Datetime when the group’s cashless refunds start. E.g. 26. 7. 2023, 13:00.

Returns:

  • (String)
    • Datetime when the group’s cashless refunds start. E.g. 26. 7. 2023, 13:00.



40
41
42
43
44
# File '/build/app/mailers/c2e_core/drops/credits_group_drop.rb', line 40

def cashless_refund_from
  return "" if @group.cashless_refund_from.nil?

  I18n.l(@group.cashless_refund_from, format: :short_year)
end

#cashless_refund_toString

Returns - Datetime when the group’s cashless refunds end. E.g. 26. 7. 2023, 13:00.

Returns:

  • (String)
    • Datetime when the group’s cashless refunds end. E.g. 26. 7. 2023, 13:00.



47
48
49
50
51
# File '/build/app/mailers/c2e_core/drops/credits_group_drop.rb', line 47

def cashless_refund_to
  return "" if @group.cashless_refund_to.nil?

  I18n.l(@group.cashless_refund_to, format: :short_year)
end

#clientCompanyClientDrop?

Returns - Company (client) of the group as drop object or null.

Returns:



31
32
33
34
35
36
37
# File '/build/app/mailers/c2e_core/drops/credits_group_drop.rb', line 31

def client
  stored_value __method__ do
    next if @group.company.nil?

    CompanyClientDrop.new(@group.company)
  end
end

#finish_closing_atString

Returns - Datetime when the group will finish closing. E.g. 26. 7. 2023, 13:00.

Returns:

  • (String)
    • Datetime when the group will finish closing. E.g. 26. 7. 2023, 13:00.



24
25
26
27
28
# File '/build/app/mailers/c2e_core/drops/credits_group_drop.rb', line 24

def finish_closing_at
  return "" if @group.finish_closing_at.nil?

  I18n.l(@group.finish_closing_at, format: :short_year)
end

#formatted_membersString

Returns - Formatted names of active company branches. E.g.: Branch A, Branch B, Branch C.

Returns:

  • (String)
    • Formatted names of active company branches. E.g.: Branch A, Branch B, Branch C.



17
18
19
20
21
# File '/build/app/mailers/c2e_core/drops/credits_group_drop.rb', line 17

def formatted_members
  stored_value __method__ do
    @group.formatted_members
  end
end

#nameString

Returns - Name of the group. E.g.: Group A.

Returns:

  • (String)
    • Name of the group. E.g.: Group A.



12
13
14
# File '/build/app/mailers/c2e_core/drops/credits_group_drop.rb', line 12

def name
  @group.name
end