Class: ShopifyTransporter::Shopify::Order
- Extended by:
- AttributesHelpers
- Defined in:
- lib/shopify_transporter/shopify/order.rb
Constant Summary
Constants inherited from Record
Record::METAFIELD_ATTRIBUTES, Record::METAFIELD_PREFIX
Class Method Summary collapse
Instance Method Summary collapse
Methods included from AttributesHelpers
add_prefix, attributes_present?, delete_empty_attributes, drop_prefix, map_from_key_to_val, normalize_keys, normalize_string, rename_fields, shopify_metafield_hash
Methods inherited from Record
has_values?, #initialize, #metafield_row_values
Constructor Details
This class inherits a constructor from ShopifyTransporter::Shopify::Record
Class Method Details
.columns ⇒ Object
37 38 39 40 41 |
# File 'lib/shopify_transporter/shopify/order.rb', line 37 def columns @columns ||= header.split(',').map do |header_column| normalize_string(header_column) end end |
.header ⇒ Object
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/shopify_transporter/shopify/order.rb', line 13 def header [ 'Name', 'Email', 'Financial Status', 'Fulfillment Status', 'Currency', 'Buyer Accepts Marketing', 'Cancel Reason', 'Cancelled At', 'Closed At', 'Tags', 'Note', 'Phone', 'Referring Site', 'Processed At', 'Source name', 'Total discounts', 'Total weight', 'Total Tax', 'Shipping Company', 'Shipping Name', 'Shipping Phone', 'Shipping First Name', 'Shipping Last Name', 'Shipping Address1', 'Shipping Address2', 'Shipping City', 'Shipping Province', 'Shipping Province Code', 'Shipping Zip', 'Shipping Country', 'Shipping Country Code', 'Billing Company', 'Billing Name', 'Billing Phone', 'Billing First Name', 'Billing Last Name', 'Billing Address1', 'Billing Address2', 'Billing City', 'Billing Province', 'Billing Province Code', 'Billing Zip', 'Billing Country', 'Billing Country Code', 'Lineitem name', 'Lineitem quantity', 'Lineitem price', 'Lineitem discount', 'Lineitem compare at price', 'Lineitem sku', 'Lineitem requires shipping', 'Lineitem taxable', 'Lineitem fulfillment status', 'Tax 1 Title', 'Tax 1 Price', 'Tax 1 Rate', 'Tax 2 Title', 'Tax 2 Price', 'Tax 2 Rate', 'Tax 3 Title', 'Tax 3 Price', 'Tax 3 Rate', 'Metafield Namespace', 'Metafield Key', 'Metafield Value', 'Metafield Value Type' ].to_csv end |
.keys ⇒ Object
33 34 35 |
# File 'lib/shopify_transporter/shopify/order.rb', line 33 def keys %w(name).freeze end |
Instance Method Details
#to_csv ⇒ Object
44 45 46 47 48 49 50 |
# File 'lib/shopify_transporter/shopify/order.rb', line 44 def to_csv CSV.generate do |csv| csv << top_level_row_values line_item_row_values.each { |row| csv << row } .each { |row| csv << row } end end |