Class: Amountable::Amount

Inherits:
ActiveRecord::Base
  • Object
show all
Includes:
Operations
Defined in:
lib/amountable/amount.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Operations

#*, #+, #-, #/, #to_money

Instance Attribute Details

#persistableObject

Returns the value of attribute persistable.



15
16
17
# File 'lib/amountable/amount.rb', line 15

def persistable
  @persistable
end

Instance Method Details

#saveObject

Raises:

  • (StandardError)


17
18
19
20
# File 'lib/amountable/amount.rb', line 17

def save
  raise StandardError.new("Can't persist amount to database") if persistable == false
  super
end