Class: Spree::StoreCreditEvent
- Defined in:
- app/models/spree/store_credit_event.rb
Instance Method Summary collapse
- #display_action ⇒ Object
- #display_amount ⇒ Object
- #display_user_total_amount ⇒ Object
- #order ⇒ Object
Methods inherited from Base
belongs_to_required_by_default, page, spree_base_scopes
Methods included from Preferences::Preferable
#clear_preferences, #default_preferences, #defined_preferences, #get_preference, #has_preference!, #has_preference?, #preference_default, #preference_type, #set_preference
Instance Method Details
#display_action ⇒ Object
21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'app/models/spree/store_credit_event.rb', line 21 def display_action case action when Spree::StoreCredit::CAPTURE_ACTION Spree.t('store_credit.captured') when Spree::StoreCredit::AUTHORIZE_ACTION Spree.t('store_credit.authorized') when Spree::StoreCredit::ALLOCATION_ACTION Spree.t('store_credit.allocated') when Spree::StoreCredit::VOID_ACTION, Spree::StoreCredit::CREDIT_ACTION Spree.t('store_credit.credit') end end |
#display_amount ⇒ Object
13 14 15 |
# File 'app/models/spree/store_credit_event.rb', line 13 def display_amount Spree::Money.new(amount, currency: currency) end |