Class: FE::Document::OtherContent

Inherits:
Object
  • Object
show all
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

Instance Method Summary collapse

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

#implementationObject

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.messages}" 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