Class: QueryReport::Report
- Inherits:
-
Object
- Object
- QueryReport::Report
- Includes:
- ColumnChartModule, ColumnModule, FilterModule, PaginateModule, PieChartModule, Record
- Defined in:
- lib/query_report/report.rb
Instance Attribute Summary collapse
-
#charts ⇒ Object
readonly
Returns the value of attribute charts.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
-
#params ⇒ Object
readonly
Returns the value of attribute params.
-
#template ⇒ Object
readonly
Returns the value of attribute template.
Attributes included from Record
Attributes included from FilterModule
Attributes included from ColumnModule
Instance Method Summary collapse
- #has_chart? ⇒ Boolean
-
#initialize(params, template, options = {}, &block) ⇒ Report
constructor
A new instance of Report.
-
#method_missing(meth, *args, &block) ⇒ Object
to support the helper methods.
Methods included from PieChartModule
Methods included from ColumnChartModule
Methods included from Record
#all_records, #apply, #filtered_query, #map_record, #model_class, #paginated_query, #records, #search
Methods included from PaginateModule
Methods included from FilterModule
#apply_filters, #filter, #load_default_values_in_param
Methods included from ColumnModule
Constructor Details
#initialize(params, template, options = {}, &block) ⇒ Report
Returns a new instance of Report.
21 22 23 24 25 26 |
# File 'lib/query_report/report.rb', line 21 def initialize(params, template, ={}, &block) @params, @template = params, template @columns, @filters, @charts = [], [], [] @options = QueryReport::DEFAULT_OPTIONS.merge instance_eval &block if block_given? end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(meth, *args, &block) ⇒ Object
to support the helper methods
42 43 44 45 46 47 48 |
# File 'lib/query_report/report.rb', line 42 def method_missing(meth, *args, &block) if @template.respond_to?(meth) @template.send(meth, *args) else super end end |
Instance Attribute Details
#charts ⇒ Object (readonly)
Returns the value of attribute charts.
19 20 21 |
# File 'lib/query_report/report.rb', line 19 def charts @charts end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
19 20 21 |
# File 'lib/query_report/report.rb', line 19 def @options end |
#params ⇒ Object (readonly)
Returns the value of attribute params.
19 20 21 |
# File 'lib/query_report/report.rb', line 19 def params @params end |
#template ⇒ Object (readonly)
Returns the value of attribute template.
19 20 21 |
# File 'lib/query_report/report.rb', line 19 def template @template end |
Instance Method Details
#has_chart? ⇒ Boolean
37 38 39 |
# File 'lib/query_report/report.rb', line 37 def has_chart? !@charts.empty? end |