Class: Relief::Parser
- Inherits:
-
Object
- Object
- Relief::Parser
- Defined in:
- lib/relief/parser.rb
Instance Attribute Summary collapse
-
#root ⇒ Object
readonly
Returns the value of attribute root.
Instance Method Summary collapse
-
#initialize(name = nil, options = {}, &block) ⇒ Parser
constructor
A new instance of Parser.
- #parse(document) ⇒ Object
Constructor Details
Instance Attribute Details
#root ⇒ Object (readonly)
Returns the value of attribute root.
6 7 8 |
# File 'lib/relief/parser.rb', line 6 def root @root end |
Instance Method Details
#parse(document) ⇒ Object
12 13 14 15 16 17 18 |
# File 'lib/relief/parser.rb', line 12 def parse(document) unless document.is_a?(Nokogiri::XML::NodeSet) document = Nokogiri::XML(document.to_s) end @root.parse(document) end |