Class: ActiveMetric::ReportViewModel::TableViewModel
- Inherits:
-
Object
- Object
- ActiveMetric::ReportViewModel::TableViewModel
- Defined in:
- lib/active_metric/report_view_model.rb
Instance Attribute Summary collapse
-
#headers ⇒ Object
readonly
Returns the value of attribute headers.
-
#rows ⇒ Object
readonly
Returns the value of attribute rows.
-
#title ⇒ Object
readonly
Returns the value of attribute title.
Instance Method Summary collapse
-
#initialize(template, table_data, options) ⇒ TableViewModel
constructor
A new instance of TableViewModel.
Constructor Details
#initialize(template, table_data, options) ⇒ TableViewModel
Returns a new instance of TableViewModel.
68 69 70 71 72 73 74 75 |
# File 'lib/active_metric/report_view_model.rb', line 68 def initialize(template, table_data, ) @title = [:title] @rows = [] @headers = template.headers table_data.each do |row_data| @rows << RowViewModel.new(row_data, template.columns) end end |
Instance Attribute Details
#headers ⇒ Object (readonly)
Returns the value of attribute headers.
66 67 68 |
# File 'lib/active_metric/report_view_model.rb', line 66 def headers @headers end |
#rows ⇒ Object (readonly)
Returns the value of attribute rows.
65 66 67 |
# File 'lib/active_metric/report_view_model.rb', line 65 def rows @rows end |
#title ⇒ Object (readonly)
Returns the value of attribute title.
64 65 66 |
# File 'lib/active_metric/report_view_model.rb', line 64 def title @title end |