Class: Fog::Parsers::Base

Inherits:
Nokogiri::XML::SAX::Document
  • Object
show all
Defined in:
lib/fog/core/parser.rb

Direct Known Subclasses

AWS::CDN::Distribution, AWS::CDN::GetDistributionList, AWS::CDN::PostInvalidation, AWS::Compute::AllocateAddress, AWS::Compute::AttachVolume, AWS::Compute::Basic, AWS::Compute::CreateImage, AWS::Compute::CreateKeyPair, AWS::Compute::CreateSnapshot, AWS::Compute::CreateVolume, AWS::Compute::DeregisterImage, AWS::Compute::DescribeAddresses, AWS::Compute::DescribeAvailabilityZones, AWS::Compute::DescribeImages, AWS::Compute::DescribeInstances, AWS::Compute::DescribeKeyPairs, AWS::Compute::DescribeRegions, AWS::Compute::DescribeReservedInstances, AWS::Compute::DescribeSecurityGroups, AWS::Compute::DescribeSnapshots, AWS::Compute::DescribeTags, AWS::Compute::DescribeVolumes, AWS::Compute::DetachVolume, AWS::Compute::GetConsoleOutput, AWS::Compute::ImportKeyPair, AWS::Compute::RegisterImage, AWS::Compute::RunInstances, AWS::Compute::StartStopInstances, AWS::Compute::TerminateInstances, AWS::DNS::ChangeResourceRecordSets, AWS::DNS::CreateHostedZone, AWS::DNS::DeleteHostedZone, AWS::DNS::GetChange, AWS::DNS::GetHostedZone, AWS::DNS::ListHostedZones, AWS::DNS::ListResourceRecordSets, AWS::ELB::CreateLoadBalancer, AWS::ELB::DeleteLoadBalancer, AWS::ELB::DeregisterInstancesFromLoadBalancer, AWS::ELB::DescribeInstanceHealth, AWS::ELB::DescribeLoadBalancers, AWS::ELB::DisableAvailabilityZonesForLoadBalancer, AWS::ELB::EnableAvailabilityZonesForLoadBalancer, AWS::ELB::RegisterInstancesWithLoadBalancer, AWS::IAM::Basic, AWS::IAM::CreateAccessKey, AWS::IAM::CreateGroup, AWS::IAM::CreateUser, AWS::IAM::GetUser, AWS::IAM::ListAccessKeys, AWS::IAM::ListGroups, AWS::IAM::ListPolicies, AWS::IAM::ListUsers, AWS::SES::DeleteVerifiedEmailAddress, AWS::SES::GetSendQuota, AWS::SES::GetSendStatistics, AWS::SES::ListVerifiedEmailAddresses, AWS::SES::SendEmail, AWS::SES::SendRawEmail, AWS::SES::VerifyEmailAddress, AWS::SimpleDB::Basic, AWS::Storage::AccessControlList, AWS::Storage::CompleteMultipartUpload, AWS::Storage::CopyObject, AWS::Storage::GetBucket, AWS::Storage::GetBucketLocation, AWS::Storage::GetBucketLogging, AWS::Storage::GetBucketObjectVersions, AWS::Storage::GetBucketVersioning, AWS::Storage::GetRequestPayment, AWS::Storage::GetService, AWS::Storage::InitiateMultipartUpload, AWS::Storage::ListMultipartUploads, AWS::Storage::ListParts, Google::Storage::AccessControlList, Google::Storage::CopyObject, Google::Storage::GetBucket, Google::Storage::GetBucketObjectVersions, Google::Storage::GetBucketVersioning, Google::Storage::GetRequestPayment, Google::Storage::GetService, Slicehost::Compute::CreateSlice, Slicehost::Compute::GetBackups, Slicehost::Compute::GetFlavor, Slicehost::Compute::GetFlavors, Slicehost::Compute::GetImage, Slicehost::Compute::GetImages, Slicehost::Compute::GetSlice, Slicehost::Compute::GetSlices, Slicehost::DNS::CreateRecord, Slicehost::DNS::CreateZone, Slicehost::DNS::GetRecord, Slicehost::DNS::GetRecords, Slicehost::DNS::GetZone, Slicehost::DNS::GetZones, Terremark::Shared::GetCatalog, Terremark::Shared::GetCatalogItem, Terremark::Shared::GetInternetServices, Terremark::Shared::GetNetworkIps, Terremark::Shared::GetNodeServices, Terremark::Shared::GetOrganization, Terremark::Shared::GetOrganizations, Terremark::Shared::GetPublicIps, Terremark::Shared::GetTasksList, Terremark::Shared::GetVappTemplate, Terremark::Shared::GetVdc, Terremark::Shared::InstantiateVappTemplate, Terremark::Shared::InternetService, Terremark::Shared::Network, Terremark::Shared::NodeService, Terremark::Shared::PublicIp, Terremark::Shared::Task, Terremark::Shared::Vapp, TerremarkEcloud::Compute::GetCatalog, TerremarkEcloud::Compute::GetCatalogItem, TerremarkEcloud::Compute::GetIpAddresses, TerremarkEcloud::Compute::GetNetwork, TerremarkEcloud::Compute::GetOrganization, TerremarkEcloud::Compute::GetVdc, TerremarkEcloud::Compute::GetVersions, TerremarkEcloud::Compute::Login, Zerigo::DNS::CountHosts, Zerigo::DNS::CountZones, Zerigo::DNS::CreateHost, Zerigo::DNS::CreateZone, Zerigo::DNS::FindHosts, Zerigo::DNS::GetHost, Zerigo::DNS::GetZone, Zerigo::DNS::GetZoneStats, Zerigo::DNS::ListHosts, Zerigo::DNS::ListZones

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeBase

Returns a new instance of Base.



7
8
9
# File 'lib/fog/core/parser.rb', line 7

def initialize
  reset
end

Instance Attribute Details

#responseObject (readonly)

Returns the value of attribute response.



5
6
7
# File 'lib/fog/core/parser.rb', line 5

def response
  @response
end

Instance Method Details

#attr_value(name, attrs) ⇒ Object



24
25
26
# File 'lib/fog/core/parser.rb', line 24

def attr_value(name, attrs)
  (entry = attrs.detect {|a, v| a == name }) && entry.last
end

#characters(string) ⇒ Object



15
16
17
18
# File 'lib/fog/core/parser.rb', line 15

def characters(string)
  @value ||= ''
  @value << string.strip
end

#resetObject



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

def reset
  @response = {}
end

#start_element(name, attrs = []) ⇒ Object



20
21
22
# File 'lib/fog/core/parser.rb', line 20

def start_element(name, attrs = [])
  @value = nil
end