Module: Qcontent::Pricing::MacroMethods

Defined in:
lib/qcontent/pricing.rb

Instance Method Summary collapse

Instance Method Details

#has_price(price_method, options = {}) ⇒ Object



32
33
34
35
36
37
38
# File 'lib/qcontent/pricing.rb', line 32

def has_price(price_method, options = {})
  include Qcontent::Pricing::InstanceMethods
  default_value = options[:default] || Money.new(0)
  attribute_name = options[:attribute] || "#{price_method}_cents"
  override = options[:override] || Proc.new { false }
  define_price_methods(price_method, attribute_name, default_value, &override)
end