Class: FE::Document::OtherContent
- Inherits:
-
Object
- Object
- FE::Document::OtherContent
- Includes:
- ActiveModel::Validations
- Defined in:
- lib/facturacr/document/other_content.rb,
lib/facturacr/document/other_content/price_smart.rb
Defined Under Namespace
Classes: PriceSmart
Instance Attribute Summary collapse
-
#implementation ⇒ Object
Returns the value of attribute implementation.
Instance Method Summary collapse
- #build_xml(node) ⇒ Object
-
#initialize(args = {}) ⇒ OtherContent
constructor
A new instance of OtherContent.
- #to_xml(builder) ⇒ Object
Constructor Details
#initialize(args = {}) ⇒ OtherContent
Returns a new instance of OtherContent.
10 11 12 |
# File 'lib/facturacr/document/other_content.rb', line 10 def initialize(args={}) @implementation = args[:implementation] end |
Instance Attribute Details
#implementation ⇒ Object
Returns the value of attribute implementation.
5 6 7 |
# File 'lib/facturacr/document/other_content.rb', line 5 def implementation @implementation end |
Instance Method Details
#build_xml(node) ⇒ Object
14 15 16 17 18 19 20 |
# File 'lib/facturacr/document/other_content.rb', line 14 def build_xml(node) raise "Invalid Record: #{errors.}" unless valid? node = Nokogiri::XML::Builder.new if node.nil? node.OtroContenido do |xml| @implementation.build_xml(xml) end end |
#to_xml(builder) ⇒ Object
22 23 24 |
# File 'lib/facturacr/document/other_content.rb', line 22 def to_xml(builder) build_xml(builder).to_xml end |