Sha256: b0f47358600ed34cce1d4cb52ece9be0e96ccd9ce8990c4f3a6197319707b423
Contents?: true
Size: 823 Bytes
Versions: 32
Compression:
Stored size: 823 Bytes
Contents
# coding: utf-8 require 'forwardable' module ONIX # super class for some simplified ONIX::Product wrappers class SimpleProduct def initialize(product = nil) @product = product || ::ONIX::Product.new end class << self include Forwardable def from_xml(xml) self.new(::ONIX::Product.from_xml(xml)) end def parse_file(filename) self.new(::ONIX::Product.parse(File.read(filename))) end def parse(xml) self.new(::ONIX::Product.parse(xml)) end protected def delegate(*args) def_delegators :@product, *args end end def product @product end def to_xml product.to_xml end # TODO: add method missing magic to proxy through to the underlying product? end end
Version data entries
32 entries across 32 versions & 2 rubygems