Module: Reporta::Reportable
- Extended by:
- ActiveSupport::Concern
- Defined in:
- lib/reporta/models/reportable.rb
Instance Attribute Summary collapse
-
#form ⇒ Object
Returns the value of attribute form.
Instance Method Summary collapse
Methods included from Column
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(*args, &block) ⇒ Object (private)
Delegate any undefined message to the @form object. This allows you to call report.start_date to get the value of the start_date filter or assign a value using ‘report.start_date = ’2013-01-01’‘
46 47 48 |
# File 'lib/reporta/models/reportable.rb', line 46 def method_missing(*args, &block) self.form.send(*args, &block) end |
Instance Attribute Details
#form ⇒ Object
Returns the value of attribute form.
28 29 30 |
# File 'lib/reporta/models/reportable.rb', line 28 def form @form end |
Instance Method Details
#id ⇒ Object
36 37 38 |
# File 'lib/reporta/models/reportable.rb', line 36 def id self.class.name.underscore end |
#initialize(args = {}) ⇒ Object
30 31 32 33 34 |
# File 'lib/reporta/models/reportable.rb', line 30 def initialize(args={}) args ||= {} @form = Reporta::Form.new filters, args form.valid? if args.present? end |