Class: Spree::StoreCreditEvent Private
- Defined in:
- app/models/spree/store_credit_event.rb
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Constant Summary collapse
- NON_EXPOSED_ACTIONS =
This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.
[Spree::StoreCredit::ELIGIBLE_ACTION, Spree::StoreCredit::AUTHORIZE_ACTION]
Instance Method Summary collapse
- #action_requires_reason? ⇒ Boolean private
- #authorization_action? ⇒ Boolean private
- #capture_action? ⇒ Boolean private
- #display_action ⇒ Object private
- #display_amount ⇒ Object private
- #display_event_date ⇒ Object private
- #display_user_total_amount ⇒ Object private
- #order ⇒ Object private
Methods inherited from Base
display_includes, #initialize_preference_defaults, page, preference
Methods included from Preferences::Preferable
#default_preferences, #defined_preferences, #get_preference, #has_preference!, #has_preference?, #preference_default, #preference_type, #set_preference
Instance Method Details
#action_requires_reason? ⇒ Boolean
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
29 30 31 |
# File 'app/models/spree/store_credit_event.rb', line 29 def action_requires_reason? [Spree::StoreCredit::ADJUSTMENT_ACTION, Spree::StoreCredit::INVALIDATE_ACTION].include?(action) end |
#authorization_action? ⇒ Boolean
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
25 26 27 |
# File 'app/models/spree/store_credit_event.rb', line 25 def action == Spree::StoreCredit::AUTHORIZE_ACTION end |
#capture_action? ⇒ Boolean
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
21 22 23 |
# File 'app/models/spree/store_credit_event.rb', line 21 def capture_action? action == Spree::StoreCredit::CAPTURE_ACTION end |
#display_action ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
45 46 47 48 |
# File 'app/models/spree/store_credit_event.rb', line 45 def display_action return if NON_EXPOSED_ACTIONS.include?(action) Spree.t("store_credit.display_action.#{action}") end |
#display_amount ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
33 34 35 |
# File 'app/models/spree/store_credit_event.rb', line 33 def display_amount Spree::Money.new(amount, { currency: currency }) end |
#display_event_date ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
41 42 43 |
# File 'app/models/spree/store_credit_event.rb', line 41 def display_event_date I18n.l(created_at.to_date, format: :long) end |
#display_user_total_amount ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
37 38 39 |
# File 'app/models/spree/store_credit_event.rb', line 37 def display_user_total_amount Spree::Money.new(user_total_amount, { currency: currency }) end |
#order ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
50 51 52 |
# File 'app/models/spree/store_credit_event.rb', line 50 def order Spree::Payment.find_by_response_code().try(:order) end |