Class: Spree::ReportLineItem
- Inherits:
-
Object
- Object
- Spree::ReportLineItem
- Includes:
- ActiveModel::Attributes, ActiveModel::Model
- Defined in:
- app/models/spree/report_line_item.rb
Direct Known Subclasses
Spree::ReportLineItems::ProductsPerformance, Spree::ReportLineItems::SalesTotal
Instance Attribute Summary collapse
-
#record ⇒ Object
Returns the value of attribute record.
-
#report ⇒ Object
Returns the value of attribute report.
Class Method Summary collapse
Instance Method Summary collapse
Instance Attribute Details
#record ⇒ Object
Returns the value of attribute record.
6 7 8 |
# File 'app/models/spree/report_line_item.rb', line 6 def record @record end |
#report ⇒ Object
Returns the value of attribute report.
6 7 8 |
# File 'app/models/spree/report_line_item.rb', line 6 def report @report end |
Class Method Details
.csv_headers ⇒ Object
17 18 19 |
# File 'app/models/spree/report_line_item.rb', line 17 def self.csv_headers attribute_types.keys end |
.headers ⇒ Object
11 12 13 14 15 |
# File 'app/models/spree/report_line_item.rb', line 11 def self.headers attribute_types.keys.map do |attribute| { name: attribute.to_sym, label: Spree.t(attribute.to_sym) } end end |
Instance Method Details
#to_csv ⇒ Object
21 22 23 24 25 |
# File 'app/models/spree/report_line_item.rb', line 21 def to_csv self.class.attribute_types.keys.map do |attribute| send(attribute) end end |