Class: Hobelar::Parsers::GetFilter
- Inherits:
-
Hobelar::Parsers
- Object
- Nokogiri::XML::SAX::Document
- Hobelar::Parsers
- Hobelar::Parsers::GetFilter
- Defined in:
- lib/hobelar/parsers/getfilter.rb
Instance Attribute Summary collapse
-
#response ⇒ Object
readonly
Returns the value of attribute response.
Instance Method Summary collapse
- #end_element(name) ⇒ Object
-
#initialize ⇒ GetFilter
constructor
A new instance of GetFilter.
- #start_element(name, attrs = []) ⇒ Object
Methods inherited from Hobelar::Parsers
Constructor Details
#initialize ⇒ GetFilter
Returns a new instance of GetFilter.
7 8 9 10 |
# File 'lib/hobelar/parsers/getfilter.rb', line 7 def initialize super @response[:rules] = [] end |
Instance Attribute Details
#response ⇒ Object (readonly)
Returns the value of attribute response.
5 6 7 |
# File 'lib/hobelar/parsers/getfilter.rb', line 5 def response @response end |
Instance Method Details
#end_element(name) ⇒ Object
25 26 27 28 29 30 31 32 |
# File 'lib/hobelar/parsers/getfilter.rb', line 25 def end_element(name) case name when "filterset" @in_fset = false when "rule" @response[:rules] << {:type => @type, :module => @module, :metric => @metric} end end |
#start_element(name, attrs = []) ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/hobelar/parsers/getfilter.rb', line 12 def start_element(name, attrs = []) super case name when "filterset" @in_fset = true when "rule" @type = attr_value("type", attrs) @module = attr_value("module", attrs) @metric = attr_value("metric", attrs) end end |