Class: Spree::StoreCreditEvent

Inherits:
Object
  • Object
show all
Extended by:
DisplayMoney
Defined in:
app/models/spree/store_credit_event.rb

Instance Method Summary collapse

Methods included from DisplayMoney

money_methods

Instance Method Details

#allocation?Boolean

Returns:

  • (Boolean)


37
38
39
# File 'app/models/spree/store_credit_event.rb', line 37

def allocation?
  action == Spree::StoreCredit::ALLOCATION_ACTION
end

#authorized?Boolean

Returns:

  • (Boolean)


53
54
55
# File 'app/models/spree/store_credit_event.rb', line 53

def authorized?
  action == Spree::StoreCredit::AUTHORIZE_ACTION
end

#captured?Boolean

Returns:

  • (Boolean)


45
46
47
# File 'app/models/spree/store_credit_event.rb', line 45

def captured?
  action == Spree::StoreCredit::CAPTURE_ACTION
end

#credit?Boolean

Returns:

  • (Boolean)


41
42
43
# File 'app/models/spree/store_credit_event.rb', line 41

def credit?
  action == Spree::StoreCredit::CREDIT_ACTION
end

#display_actionObject



22
23
24
25
26
27
28
29
30
31
32
33
34
35
# File 'app/models/spree/store_credit_event.rb', line 22

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::ELIGIBLE_ACTION
    Spree.t('store_credit.eligible')
  when Spree::StoreCredit::VOID_ACTION, Spree::StoreCredit::CREDIT_ACTION
    Spree.t('store_credit.credit')
  end
end

#voided?Boolean

Returns:

  • (Boolean)


49
50
51
# File 'app/models/spree/store_credit_event.rb', line 49

def voided?
  action == Spree::StoreCredit::VOID_ACTION
end