Class: ActiveMetric::ReportViewModel::RowViewModel
- Inherits:
-
Object
- Object
- ActiveMetric::ReportViewModel::RowViewModel
- Defined in:
- lib/active_metric/report_view_model.rb
Instance Attribute Summary collapse
-
#cells ⇒ Object
readonly
Returns the value of attribute cells.
-
#has_series ⇒ Object
readonly
Returns the value of attribute has_series.
-
#row_id ⇒ Object
readonly
Returns the value of attribute row_id.
Instance Method Summary collapse
-
#initialize(row_data, columns) ⇒ RowViewModel
constructor
A new instance of RowViewModel.
Constructor Details
#initialize(row_data, columns) ⇒ RowViewModel
Returns a new instance of RowViewModel.
83 84 85 86 87 88 89 90 91 |
# File 'lib/active_metric/report_view_model.rb', line 83 def initialize(row_data, columns) @cells = [] @row_id = row_data.to_param @has_series = row_data.has_graph_data columns.each do |col| value = row_data.send(col.field) cells << CellViewModel.new(value, col.) end end |
Instance Attribute Details
#cells ⇒ Object (readonly)
Returns the value of attribute cells.
79 80 81 |
# File 'lib/active_metric/report_view_model.rb', line 79 def cells @cells end |
#has_series ⇒ Object (readonly)
Returns the value of attribute has_series.
81 82 83 |
# File 'lib/active_metric/report_view_model.rb', line 81 def has_series @has_series end |
#row_id ⇒ Object (readonly)
Returns the value of attribute row_id.
80 81 82 |
# File 'lib/active_metric/report_view_model.rb', line 80 def row_id @row_id end |