Module: Mddb::Calculations
Defined Under Namespace
Modules: ClassMethods
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.included(klass) ⇒ Object
22 23 24 |
# File 'lib/mddb/calculations.rb', line 22 def self.included(klass) klass.extend ClassMethods end |
Instance Method Details
#list_calculations ⇒ Object
14 15 16 17 18 19 20 |
# File 'lib/mddb/calculations.rb', line 14 def list_calculations begin get_calculations rescue raise "You haven't added any calculations to the calculations macro" end end |
#run ⇒ Object
3 4 5 6 7 8 9 10 11 12 |
# File 'lib/mddb/calculations.rb', line 3 def run begin get_calculations.each do |c| self.send(c) end self.save rescue raise "You haven't added any calculations to the calculations macro" end end |