module Reporta::Reportable

Attributes

form[RW]

Public Class Methods

new(args={}) click to toggle source
# File lib/reporta/models/reportable.rb, line 30
def initialize(args={})
  args ||= {}
  @form = Reporta::Form.new filters, args
  form.valid? if args.present?
end

Public Instance Methods

id() click to toggle source
# File lib/reporta/models/reportable.rb, line 36
def id
  self.class.name.underscore
end

Private Instance Methods

method_missing(*args, &block) click to toggle source

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’‘

# File lib/reporta/models/reportable.rb, line 46
def method_missing(*args, &block)
  self.form.send(*args, &block)
end