Class: Fog::Parsers::ProfitBricks::Base
- Inherits:
-
Nokogiri::XML::SAX::Document
- Object
- Nokogiri::XML::SAX::Document
- Fog::Parsers::ProfitBricks::Base
- Defined in:
- lib/fog/profitbricks/parsers/base.rb
Direct Known Subclasses
Compute::ProfitBricks::ClearDataCenter, Compute::ProfitBricks::ConnectStorageToServer, Compute::ProfitBricks::CreateDataCenter, Compute::ProfitBricks::CreateNic, Compute::ProfitBricks::CreateServer, Compute::ProfitBricks::CreateStorage, Compute::ProfitBricks::DeleteDataCenter, Compute::ProfitBricks::DeleteNic, Compute::ProfitBricks::DeleteServer, Compute::ProfitBricks::DeleteStorage, Compute::ProfitBricks::DisconnectStorageFromServer, Compute::ProfitBricks::GetAllDataCenters, Compute::ProfitBricks::GetAllImages, Compute::ProfitBricks::GetAllNic, Compute::ProfitBricks::GetAllServers, Compute::ProfitBricks::GetAllStorages, Compute::ProfitBricks::GetDataCenter, Compute::ProfitBricks::GetDataCenterState, Compute::ProfitBricks::GetImage, Compute::ProfitBricks::GetNic, Compute::ProfitBricks::GetServer, Compute::ProfitBricks::GetStorage, Compute::ProfitBricks::ResetServer, Compute::ProfitBricks::SetInternetAccess, Compute::ProfitBricks::UpdateDataCenter, Compute::ProfitBricks::UpdateNic, Compute::ProfitBricks::UpdateServer, Compute::ProfitBricks::UpdateStorage
Instance Attribute Summary collapse
-
#response ⇒ Object
readonly
Returns the value of attribute response.
Instance Method Summary collapse
- #attr_value(name, attrs) ⇒ Object
- #characters(string) ⇒ Object
- #end_element_namespace(name, prefix = nil, uri = nil) ⇒ Object
-
#initialize ⇒ Base
constructor
A new instance of Base.
- #reset ⇒ Object
-
#start_element(name, attrs = []) ⇒ Object
###############################################################################.
-
#start_element_namespace(name, attrs = [], prefix = nil, uri = nil, ns = []) ⇒ Object
############################################################################### This is a workaround.
- #value ⇒ Object
Constructor Details
#initialize ⇒ Base
Returns a new instance of Base.
9 10 11 |
# File 'lib/fog/profitbricks/parsers/base.rb', line 9 def initialize reset end |
Instance Attribute Details
#response ⇒ Object (readonly)
Returns the value of attribute response.
7 8 9 |
# File 'lib/fog/profitbricks/parsers/base.rb', line 7 def response @response end |
Instance Method Details
#attr_value(name, attrs) ⇒ Object
13 14 15 |
# File 'lib/fog/profitbricks/parsers/base.rb', line 13 def attr_value(name, attrs) (entry = attrs.find {|a, v| a == name }) && entry.last end |
#characters(string) ⇒ Object
21 22 23 24 |
# File 'lib/fog/profitbricks/parsers/base.rb', line 21 def characters(string) @value ||= '' @value << string end |
#end_element_namespace(name, prefix = nil, uri = nil) ⇒ Object
33 34 35 |
# File 'lib/fog/profitbricks/parsers/base.rb', line 33 def end_element_namespace name, prefix = nil, uri = nil end_element name end |
#reset ⇒ Object
17 18 19 |
# File 'lib/fog/profitbricks/parsers/base.rb', line 17 def reset @response = {} end |
#start_element(name, attrs = []) ⇒ Object
###############################################################################
39 40 41 |
# File 'lib/fog/profitbricks/parsers/base.rb', line 39 def start_element(name, attrs = []) @value = nil end |
#start_element_namespace(name, attrs = [], prefix = nil, uri = nil, ns = []) ⇒ Object
############################################################################### This is a workaround. Original implementation from Nokogiri is overwritten with one that does not join namespace prefix with local name.
29 30 31 |
# File 'lib/fog/profitbricks/parsers/base.rb', line 29 def start_element_namespace name, attrs = [], prefix = nil, uri = nil, ns = [] start_element name, attrs end |
#value ⇒ Object
43 44 45 |
# File 'lib/fog/profitbricks/parsers/base.rb', line 43 def value @value && @value.dup end |