class Cacofonix::SimpleProduct

super class for some simplified Cacofonix::Product wrappers

Public Class Methods

from_xml(xml) click to toggle source
# File lib/cacofonix/wrappers/simple_product.rb, line 17
def from_xml(xml)
  self.new(::Cacofonix::Product.from_xml(xml))
end
new(product = nil) click to toggle source
# File lib/cacofonix/wrappers/simple_product.rb, line 9
def initialize(product = nil)
  @product = product || ::Cacofonix::Product.new
end
parse(xml) click to toggle source
# File lib/cacofonix/wrappers/simple_product.rb, line 25
def parse(xml)
  self.new(::Cacofonix::Product.parse(xml))
end
parse_file(filename) click to toggle source
# File lib/cacofonix/wrappers/simple_product.rb, line 21
def parse_file(filename)
  self.new(::Cacofonix::Product.parse(File.read(filename)))
end

Protected Class Methods

delegate(*args) click to toggle source
# File lib/cacofonix/wrappers/simple_product.rb, line 31
def delegate(*args)
  def_delegators :@product, *args
end

Public Instance Methods

product() click to toggle source
# File lib/cacofonix/wrappers/simple_product.rb, line 36
def product
  @product
end
to_xml() click to toggle source
# File lib/cacofonix/wrappers/simple_product.rb, line 40
def to_xml
  product.to_xml
end