Class: Billing::Modifier
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- Billing::Modifier
- Includes:
- AccountItem
- Defined in:
- app/models/billing/modifier.rb
Class Method Summary collapse
Class Method Details
.args(*args) ⇒ Object
19 20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'app/models/billing/modifier.rb', line 19 def args(*args) case when args.blank? || args.first.kind_of?(Hash) then {}.merge(*args) when args.first.kind_of?(String) then d = args.shift if d.index('%') #TODO parse end else h = { fixed_value: args.shift.to_money } args.any? ? h.merge(*args) : h end end |