Class: Spree::Reimbursement::ReimbursementTypeEngine
- Inherits:
-
Object
- Object
- Spree::Reimbursement::ReimbursementTypeEngine
- Includes:
- ReimbursementTypeValidator
- Defined in:
- app/models/spree/reimbursement/reimbursement_type_engine.rb
Instance Method Summary collapse
- #calculate_reimbursement_types ⇒ Object
-
#initialize(return_items) ⇒ ReimbursementTypeEngine
constructor
A new instance of ReimbursementTypeEngine.
Methods included from ReimbursementTypeValidator
#past_reimbursable_time_period?, #valid_preferred_reimbursement_type?
Constructor Details
#initialize(return_items) ⇒ ReimbursementTypeEngine
Returns a new instance of ReimbursementTypeEngine.
19 20 21 22 |
# File 'app/models/spree/reimbursement/reimbursement_type_engine.rb', line 19 def initialize(return_items) @return_items = return_items @reimbursement_type_hash = Hash.new { |hash, key| hash[key] = [] } end |
Instance Method Details
#calculate_reimbursement_types ⇒ Object
24 25 26 27 28 29 30 31 |
# File 'app/models/spree/reimbursement/reimbursement_type_engine.rb', line 24 def calculate_reimbursement_types @return_items.each do |return_item| reimbursement_type = calculate_reimbursement_type(return_item) add_reimbursement_type(return_item, reimbursement_type) end @reimbursement_type_hash end |