Class: Saulabs::Reportable::ResultSet
- Inherits:
-
Object
- Object
- Saulabs::Reportable::ResultSet
- Defined in:
- lib/saulabs/reportable/result_set.rb
Overview
A result set as it is returned by the report methods. This is basically a subclass of Array
that adds two attributes, model_class_name
and report_name
that store the name of the model and the report the result set was generated from.
Instance Attribute Summary collapse
-
#model_class_name ⇒ Object
readonly
the name of the model the result set is based on.
-
#report_name ⇒ Object
readonly
the name of the report the result is based on.
Instance Method Summary collapse
-
#initialize(array, model_class_name, report_name) ⇒ ResultSet
constructor
Initializes a new result set.
-
#to_a ⇒ Object
array representation of the result.
Constructor Details
#initialize(array, model_class_name, report_name) ⇒ ResultSet
Initializes a new result set.
36 37 38 39 40 |
# File 'lib/saulabs/reportable/result_set.rb', line 36 def initialize(array, model_class_name, report_name) @results = array @model_class_name = model_class_name @report_name = report_name.to_s end |
Instance Attribute Details
#model_class_name ⇒ Object (readonly)
the name of the model the result set is based on
15 16 17 |
# File 'lib/saulabs/reportable/result_set.rb', line 15 def model_class_name @model_class_name end |
#report_name ⇒ Object (readonly)
the name of the report the result is based on
19 20 21 |
# File 'lib/saulabs/reportable/result_set.rb', line 19 def report_name @report_name end |
Instance Method Details
#to_a ⇒ Object
array representation of the result
23 24 25 |
# File 'lib/saulabs/reportable/result_set.rb', line 23 def to_a @results end |