Sha256: f535f616a962c6e602898d3ae6fbdcb398d354fdce9e40da1a394eb1c1124f4e

Contents?: true

Size: 566 Bytes

Versions: 1

Compression:

Stored size: 566 Bytes

Contents

require 'fake_chargify/product_family'

module FakeChargify
  class Product
    attr_accessor :accounting_code, :handle, :interval, :name, :price_in_cents, :family
    
    def to_xml
      builder = Nokogiri::XML::Builder.new do |xml|
        xml.product {
          xml.accounting_code accounting_code
          xml.handle handle
          xml.interval interval
          xml.name name
          xml.price_in_cents price_in_cents
          xml << Nokogiri.XML(family.to_xml).root.to_xml unless family.nil?
        }
      end
      builder.to_xml
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
fake_chargify-0.1.0 lib/fake_chargify/product.rb