Class: C2eCore::Drops::CreditsGroupDrop
- Defined in:
- /build/app/mailers/c2e_core/drops/credits_group_drop.rb
Instance Method Summary collapse
-
#cashless_refund_from ⇒ String
-
Datetime when the group’s cashless refunds start.
-
-
#cashless_refund_to ⇒ String
-
Datetime when the group’s cashless refunds end.
-
-
#client ⇒ CompanyClientDrop?
-
Company (client) of the group as drop object or
null
.
-
-
#finish_closing_at ⇒ String
-
Datetime when the group will finish closing.
-
-
#formatted_members ⇒ String
-
Formatted names of active company branches.
-
-
#initialize(group) ⇒ CreditsGroupDrop
constructor
A new instance of CreditsGroupDrop.
-
#name ⇒ String
-
Name of the group.
-
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_from ⇒ String
Returns - 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_to ⇒ String
Returns - 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 |
#client ⇒ CompanyClientDrop?
Returns - Company (client) of the group as drop object or null
.
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_at ⇒ String
Returns - 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_members ⇒ String
Returns - 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 |
#name ⇒ String
Returns - 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 |