Class: FE::Document::OtherText
- Inherits:
-
Object
- Object
- FE::Document::OtherText
- Defined in:
- lib/facturacr/document/other_text.rb
Instance Attribute Summary collapse
-
#content ⇒ Object
Returns the value of attribute content.
-
#xml_attributes ⇒ Object
Returns the value of attribute xml_attributes.
Instance Method Summary collapse
- #build_xml(node) ⇒ Object
-
#initialize(args = {}) ⇒ OtherText
constructor
A new instance of OtherText.
Constructor Details
#initialize(args = {}) ⇒ OtherText
Returns a new instance of OtherText.
8 9 10 11 |
# File 'lib/facturacr/document/other_text.rb', line 8 def initialize(args={}) @xml_attributes = args[:xml_attributes] || {} @content = args[:content] end |
Instance Attribute Details
#content ⇒ Object
Returns the value of attribute content.
4 5 6 |
# File 'lib/facturacr/document/other_text.rb', line 4 def content @content end |
#xml_attributes ⇒ Object
Returns the value of attribute xml_attributes.
4 5 6 |
# File 'lib/facturacr/document/other_text.rb', line 4 def xml_attributes @xml_attributes end |
Instance Method Details
#build_xml(node) ⇒ Object
13 14 15 16 17 18 19 20 |
# File 'lib/facturacr/document/other_text.rb', line 13 def build_xml(node) raise "xml_attributes is not a Hash" unless @xml_attributes.is_a?(Hash) node = Nokogiri::XML::Builder.new if node.nil? node.OtroTexto(@xml_attributes) do |xml| xml.text(@content) end end |