Class: Slaw::AknBase
Constant Summary
Constants included from Namespace
Instance Attribute Summary collapse
-
#doc ⇒ Object
Returns the value of attribute doc.
Instance Method Summary collapse
-
#parse(io) ⇒ Object
Parse the XML contained in the file-like or String object ‘io`.
-
#to_xml(*args) ⇒ String
Serialise the XML for this act, passing ‘args` to the Nokogiri serialiser.
Instance Attribute Details
#doc ⇒ Object
Returns the value of attribute doc.
5 6 7 |
# File 'lib/slaw/act.rb', line 5 def doc @doc end |
Instance Method Details
#parse(io) ⇒ Object
Parse the XML contained in the file-like or String object ‘io`
18 19 20 |
# File 'lib/slaw/act.rb', line 18 def parse(io) self.doc = Nokogiri::XML(io) end |
#to_xml(*args) ⇒ String
Serialise the XML for this act, passing ‘args` to the Nokogiri serialiser. The most useful argument is usually `indent: 2` if you like your XML perdy.
11 12 13 |
# File 'lib/slaw/act.rb', line 11 def to_xml(*args) @doc.to_xml(*args) end |