Class: Parser
- Inherits:
-
Nokogiri::XML::SAX::Document
- Object
- Nokogiri::XML::SAX::Document
- Parser
- Defined in:
- lib/bbcloud/vendor/fog-0.3.23/benchs/parse_vs_push.rb
Instance Attribute Summary collapse
-
#response ⇒ Object
readonly
Returns the value of attribute response.
Instance Method Summary collapse
- #characters(string) ⇒ Object
- #end_element(name) ⇒ Object
-
#initialize ⇒ Parser
constructor
A new instance of Parser.
- #reset ⇒ Object
- #start_element(name, attrs = []) ⇒ Object
Constructor Details
Instance Attribute Details
#response ⇒ Object (readonly)
Returns the value of attribute response.
7 8 9 |
# File 'lib/bbcloud/vendor/fog-0.3.23/benchs/parse_vs_push.rb', line 7 def response @response end |
Instance Method Details
#characters(string) ⇒ Object
18 19 20 |
# File 'lib/bbcloud/vendor/fog-0.3.23/benchs/parse_vs_push.rb', line 18 def characters(string) @value << string.strip end |
#end_element(name) ⇒ Object
26 27 28 29 30 31 32 33 34 |
# File 'lib/bbcloud/vendor/fog-0.3.23/benchs/parse_vs_push.rb', line 26 def end_element(name) case name when 'item' @response[:items] << @item @item = {} when 'key' @item[:key] = @value end end |
#reset ⇒ Object
13 14 15 16 |
# File 'lib/bbcloud/vendor/fog-0.3.23/benchs/parse_vs_push.rb', line 13 def reset @item = {} @response = { :items => [] } end |
#start_element(name, attrs = []) ⇒ Object
22 23 24 |
# File 'lib/bbcloud/vendor/fog-0.3.23/benchs/parse_vs_push.rb', line 22 def start_element(name, attrs = []) @value = nil end |