Class: ONIX::SimpleProduct
- Inherits:
-
Object
- Object
- ONIX::SimpleProduct
- Extended by:
- Forwardable
- Defined in:
- lib/onix/simple_product.rb
Overview
super class for some simplified ONIX::Product wrappers
Direct Known Subclasses
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(product = nil) ⇒ SimpleProduct
constructor
A new instance of SimpleProduct.
- #product ⇒ Object
- #to_xml ⇒ Object
Constructor Details
#initialize(product = nil) ⇒ SimpleProduct
Returns a new instance of SimpleProduct.
9 10 11 |
# File 'lib/onix/simple_product.rb', line 9 def initialize(product = nil) @product = product || ::ONIX::Product.new end |
Class Method Details
.from_xml(xml) ⇒ Object
17 18 19 |
# File 'lib/onix/simple_product.rb', line 17 def from_xml(xml) self.new(::ONIX::Product.from_xml(xml)) end |
Instance Method Details
#product ⇒ Object
36 37 38 |
# File 'lib/onix/simple_product.rb', line 36 def product @product end |
#to_xml ⇒ Object
40 41 42 |
# File 'lib/onix/simple_product.rb', line 40 def to_xml product.to_xml end |