Class: Slaw::AknBase

Inherits:
Object
  • Object
show all
Includes:
Namespace
Defined in:
lib/slaw/act.rb

Direct Known Subclasses

Act, Fragment

Constant Summary

Constants included from Namespace

Namespace::NS

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#docObject

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`

Parameters:

  • io (String, file-like)

    io object or String with XML



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.

Returns:

  • (String)

    serialized XML



11
12
13
# File 'lib/slaw/act.rb', line 11

def to_xml(*args)
  @doc.to_xml(*args)
end