Class: Xrc::Parser

Inherits:
REXML::Parsers::SAX2Parser
  • Object
show all
Defined in:
lib/xrc/parser.rb

Constant Summary collapse

EVENTS =
[
  :cdata,
  :characters,
  :end_document,
  :end_element,
  :start_element,
]

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options, &block) ⇒ Parser

Returns a new instance of Parser.



15
16
17
18
19
# File 'lib/xrc/parser.rb', line 15

def initialize(options, &block)
  super(options[:socket])
  @block = block
  bind
end

Instance Attribute Details

#blockObject (readonly)

Returns the value of attribute block.



13
14
15
# File 'lib/xrc/parser.rb', line 13

def block
  @block
end

#currentObject

Returns the value of attribute current.



11
12
13
# File 'lib/xrc/parser.rb', line 11

def current
  @current
end

#optionsObject (readonly)

Returns the value of attribute options.



13
14
15
# File 'lib/xrc/parser.rb', line 13

def options
  @options
end