Sha256: 55163db8402823921c72ffe912e61c399c00d199a442611a5899dcb3287602f9

Contents?: true

Size: 1.14 KB

Versions: 4

Compression:

Stored size: 1.14 KB

Contents

$LOAD_PATH.unshift(File.dirname(__FILE__) + '/../lib')

require 'cacofonix'

File.open('output.xml', "w") do |output|
  header = Cacofonix::Header.new
  header.from_company = "Sample Company"
  header.from_person  = "James"
  header.sent_date = Time.now

  writer = Cacofonix::Writer.new(output, header)

  product = Cacofonix::APAProduct.new
  product.notification_type = 2
  product.record_reference = 1
  product.isbn10 = "1844836902"
  product.isbn13 = "9781844836901"
  product.title = "1001 Pearls of Bible Wisdom"
  product.subtitle = "Boo"
  product.supplier_website = "http://www.rainbowbooks.com.au/title/show/9781844836901"
  product.add_contributor("Healy, James")
  product.imprint = "Malhame"
  product.publisher = "Dover"
  product.sales_restriction_type = 0
  product.supplier_name = "Rainbow Book Agencies"
  product.supplier_phone = "+61 3 9481 6611"
  product.supplier_fax = "+61 3 9481 2371"
  product.supplier_email = "rba@rainbowbooks.com.au"
  product.supply_country = "AU"
  product.product_availability = 20
  #product.on_hand = 10
  #product.on_order = 20
  #product.rrp_inc_sales_tax = 29.95

  writer << product

  writer.end_document
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
cacofonix-0.10.3 examples/writer_apa.rb
cacofonix-0.10.2 examples/writer_apa.rb
cacofonix-0.10.1 examples/writer_apa.rb
cacofonix-0.10.0 examples/writer_apa.rb