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::CloudFormation::Basic, AWS::CloudFormation::CreateStack, AWS::CloudFormation::DescribeStackEvents, AWS::CloudFormation::DescribeStackResources, AWS::CloudFormation::DescribeStacks, AWS::CloudFormation::GetTemplate, AWS::CloudFormation::ValidateTemplate, 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::DescribeReservedInstancesOfferings, AWS::Compute::DescribeSecurityGroups, AWS::Compute::DescribeSnapshots, AWS::Compute::DescribeTags, AWS::Compute::DescribeVolumes, AWS::Compute::DetachVolume, AWS::Compute::GetConsoleOutput, AWS::Compute::ImportKeyPair, AWS::Compute::MonitorUnmonitorInstances, 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::ConfigureHealthCheck, AWS::ELB::CreateLoadBalancer, AWS::ELB::DeleteLoadBalancer, AWS::ELB::DeregisterInstancesFromLoadBalancer, AWS::ELB::DescribeInstanceHealth, AWS::ELB::DescribeLoadBalancers, AWS::ELB::DisableAvailabilityZonesForLoadBalancer, AWS::ELB::Empty, AWS::ELB::EnableAvailabilityZonesForLoadBalancer, AWS::ELB::RegisterInstancesWithLoadBalancer, AWS::IAM::Basic, AWS::IAM::CreateAccessKey, AWS::IAM::CreateGroup, AWS::IAM::CreateUser, AWS::IAM::GetGroup, AWS::IAM::GetUser, AWS::IAM::GetUserPolicy, AWS::IAM::ListAccessKeys, AWS::IAM::ListGroups, AWS::IAM::ListGroupsForUser, AWS::IAM::ListPolicies, AWS::IAM::ListServerCertificates, AWS::IAM::ListSigningCertificates, AWS::IAM::ListUsers, AWS::IAM::LoginProfile, AWS::IAM::UpdateGroup, AWS::IAM::UpdateUser, AWS::IAM::UploadServerCertificate, AWS::IAM::UploadSigningCertificate, AWS::RDS::CreateDbParameterGroup, AWS::RDS::DbParser, AWS::RDS::DeleteDbParameterGroup, AWS::RDS::DescribeDBParameterGroups, AWS::RDS::DescribeDBParameters, AWS::RDS::ModifyDbParameterGroup, AWS::RDS::SecurityGroupParser, AWS::RDS::SnapshotParser, 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::GetBucketWebsite, AWS::Storage::GetRequestPayment, AWS::Storage::GetService, AWS::Storage::InitiateMultipartUpload, AWS::Storage::ListMultipartUploads, AWS::Storage::ListParts, Fog::Parsers::Bluebox::DNS::CreateRecord, Fog::Parsers::Bluebox::DNS::CreateZone, Fog::Parsers::Bluebox::DNS::GetRecord, Fog::Parsers::Bluebox::DNS::GetRecords, Fog::Parsers::Bluebox::DNS::GetZone, Fog::Parsers::Bluebox::DNS::GetZones, 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, Voxel::Compute::Basic, Voxel::Compute::DevicesList, Voxel::Compute::ImagesList, Voxel::Compute::VoxcloudCreate, Voxel::Compute::VoxcloudDelete, Voxel::Compute::VoxcloudStatus, 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.



9
10
11
# File 'lib/fog/core/parser.rb', line 9

def initialize
  reset
end

Instance Attribute Details

#responseObject (readonly)

Returns the value of attribute response.



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

def response
  @response
end

Instance Method Details

#attr_value(name, attrs) ⇒ Object



13
14
15
# File 'lib/fog/core/parser.rb', line 13

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

#characters(string) ⇒ Object



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

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

#resetObject



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

def reset
  @response = {}
end

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



26
27
28
# File 'lib/fog/core/parser.rb', line 26

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

#valueObject



30
31
32
# File 'lib/fog/core/parser.rb', line 30

def value
  @value && @value.dup
end