Sha256: dc7a25089085200ae568a428f837e8ab7dd231efc24b7c3a0c0b55134e6a0768
Contents?: true
Size: 537 Bytes
Versions: 5
Compression:
Stored size: 537 Bytes
Contents
require 'json' module SolidusMailchimpSync # Line item for Cart or Order, mailchimp serializes the same class LineItemSerializer attr_reader :line_item def initialize(line_item) @line_item = line_item end def as_json { id: line_item.id.to_s, product_id: line_item.product.id.to_s, product_variant_id: line_item.variant.id.to_s, quantity: line_item.quantity, price: line_item.price.to_f } end def to_json JSON.dump(as_json) end end end
Version data entries
5 entries across 5 versions & 1 rubygems