Class: Exporter::Items

Inherits:
Base
  • Object
show all
Defined in:
lib/exporter/items.rb

Instance Attribute Summary

Attributes inherited from Base

#cart

Instance Method Summary collapse

Methods inherited from Base

#initialize, #to_csv

Constructor Details

This class inherits a constructor from Exporter::Base

Instance Method Details

#cart_itemsObject


7
8
9
# File 'lib/exporter/items.rb', line 7

def cart_items
  self.cart.cart_items
end

#headersObject


3
4
5
# File 'lib/exporter/items.rb', line 3

def headers
  CartItem.attributes
end

#rowsObject


11
12
13
# File 'lib/exporter/items.rb', line 11

def rows
  self.cart_items.map(&:to_a)
end