class Fog::Parsers::Base

Attributes

response[R]

Public Class Methods

new() click to toggle source
# File lib/fog/parsers/base.rb, line 8
def initialize
  reset
end

Public Instance Methods

attr_value(name, attrs) click to toggle source
# File lib/fog/parsers/base.rb, line 12
def attr_value(name, attrs)
  (entry = attrs.find {|a| a.localname == name }) && entry.value
end
characters(string) click to toggle source
# File lib/fog/parsers/base.rb, line 20
def characters(string)
  @value ||= ''
  @value << string
end
end_element_namespace(name, prefix = nil, uri = nil) click to toggle source
# File lib/fog/parsers/base.rb, line 32
def end_element_namespace name, prefix = nil, uri = nil
  end_element name
end
reset() click to toggle source
# File lib/fog/parsers/base.rb, line 16
def reset
  @response = {}
end
start_element(name, attrs = []) click to toggle source
# File lib/fog/parsers/base.rb, line 38
def start_element(name, attrs = [])
  @value = nil
end
start_element_namespace(name, attrs = [], prefix = nil, uri = nil, ns = []) click to toggle source

############################################################################### This is a workaround. Original implementation from Nokogiri is overwritten with one that does not join namespace prefix with local name.

# File lib/fog/parsers/base.rb, line 28
def start_element_namespace name, attrs = [], prefix = nil, uri = nil, ns = []
  start_element name, attrs
end
value() click to toggle source
# File lib/fog/parsers/base.rb, line 42
def value
  @value && @value.dup
end