Class: Spree::ReportLineItem

Inherits:
Object
  • Object
show all
Includes:
ActiveModel::Attributes, ActiveModel::Model
Defined in:
app/models/spree/report_line_item.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#recordObject

Returns the value of attribute record.



6
7
8
# File 'app/models/spree/report_line_item.rb', line 6

def record
  @record
end

#reportObject

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_headersObject



17
18
19
# File 'app/models/spree/report_line_item.rb', line 17

def self.csv_headers
  attribute_types.keys
end

.headersObject



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_csvObject



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