Class: C2eCore::Drops::PromoCodeProgressDrop
- Defined in:
- /build/app/mailers/c2e_core/drops/promo_code_progress_drop.rb
Instance Method Summary collapse
-
#applicable_count ⇒ Integer
-
Number of items (pizzas / orders) customer already collected during this action.
-
-
#company_branch ⇒ CompanyBranchDrop
-
Company branch which given this promo code as drop object.
-
-
#description ⇒ String
-
Description of rule this notification is associated.
-
-
#initialize(args) ⇒ PromoCodeProgressDrop
constructor
A new instance of PromoCodeProgressDrop.
-
#remaining_count ⇒ Integer
-
Number of items (pizzas / orders) customer need to collect to claim promo code.
-
-
#rules_url ⇒ String?
-
URL with rules of this action.
-
-
#unsubscribe_url ⇒ String
-
URL for unsubscribing from marketing actions.
-
-
#validity ⇒ DateTime
-
Datetime object containing validity of information in this email.
-
Constructor Details
#initialize(args) ⇒ PromoCodeProgressDrop
Returns a new instance of PromoCodeProgressDrop.
7 8 9 10 11 12 13 14 15 |
# File '/build/app/mailers/c2e_core/drops/promo_code_progress_drop.rb', line 7 def initialize(args) super() @company_branch = args[:company_branch] @customer = args[:customer] @options = args[:options] @applicable_count = args[:applicable_count] @remaining_count = args[:remaining_count] @validity = args[:validity] end |
Instance Method Details
#applicable_count ⇒ Integer
Returns - Number of items (pizzas / orders) customer already collected during this action. E.g.: 8.
36 37 38 |
# File '/build/app/mailers/c2e_core/drops/promo_code_progress_drop.rb', line 36 def applicable_count @applicable_count end |
#company_branch ⇒ CompanyBranchDrop
Returns - Company branch which given this promo code as drop object.
18 19 20 21 22 |
# File '/build/app/mailers/c2e_core/drops/promo_code_progress_drop.rb', line 18 def company_branch stored_value __method__ do CompanyBranchDrop.new @company_branch end end |
#description ⇒ String
Returns - Description of rule this notification is associated.
31 32 33 |
# File '/build/app/mailers/c2e_core/drops/promo_code_progress_drop.rb', line 31 def description C2eCore::JsonLocalization.locale_for(@options["description"]["full"], I18n.locale).to_s end |
#remaining_count ⇒ Integer
Returns - Number of items (pizzas / orders) customer need to collect to claim promo code. E.g.: 2.
41 42 43 |
# File '/build/app/mailers/c2e_core/drops/promo_code_progress_drop.rb', line 41 def remaining_count @remaining_count end |
#rules_url ⇒ String?
Returns - URL with rules of this action.
46 47 48 |
# File '/build/app/mailers/c2e_core/drops/promo_code_progress_drop.rb', line 46 def rules_url @options["url"] end |
#unsubscribe_url ⇒ String
Returns - URL for unsubscribing from marketing actions.
51 52 53 |
# File '/build/app/mailers/c2e_core/drops/promo_code_progress_drop.rb', line 51 def unsubscribe_url C2eCore::Users::MarketingService.new(customer_id: @customer.id, company_branch_id: @company_branch.id).unsubscribe_url end |
#validity ⇒ DateTime
Returns - Datetime object containing validity of information in this email. E.g.: “2020-11-16T11:38:56+01:00”.
26 27 28 |
# File '/build/app/mailers/c2e_core/drops/promo_code_progress_drop.rb', line 26 def validity @validity end |