Class: Fog::Parsers::Base

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

Direct Known Subclasses

AWS::AutoScaling::Basic, AWS::AutoScaling::DescribeAdjustmentTypes, AWS::AutoScaling::DescribeAutoScalingGroups, AWS::AutoScaling::DescribeAutoScalingInstances, AWS::AutoScaling::DescribeLaunchConfigurations, AWS::AutoScaling::DescribeMetricCollectionTypes, AWS::AutoScaling::DescribePolicies, AWS::AutoScaling::DescribeScalingActivities, AWS::AutoScaling::DescribeScalingProcessTypes, AWS::AutoScaling::DescribeScheduledActions, AWS::AutoScaling::PutNotificationConfiguration, AWS::AutoScaling::PutScalingPolicy, AWS::AutoScaling::TerminateInstanceInAutoScalingGroup, AWS::CloudFormation::Basic, AWS::CloudFormation::CreateStack, AWS::CloudFormation::DescribeStackEvents, AWS::CloudFormation::DescribeStackResources, AWS::CloudFormation::DescribeStacks, AWS::CloudFormation::GetTemplate, AWS::CloudFormation::UpdateStack, AWS::CloudFormation::ValidateTemplate, AWS::CloudWatch::DeleteAlarms, AWS::CloudWatch::DescribeAlarmHistory, AWS::CloudWatch::DescribeAlarms, AWS::CloudWatch::DescribeAlarmsForMetric, AWS::CloudWatch::DisableAlarmActions, AWS::CloudWatch::EnableAlarmActions, AWS::CloudWatch::GetMetricStatistics, AWS::CloudWatch::ListMetrics, AWS::CloudWatch::PutMetricAlarm, AWS::CloudWatch::PutMetricData, AWS::CloudWatch::SetAlarmState, AWS::ELB::ApplySecurityGroupsToLoadBalancer, AWS::ELB::AttachLoadBalancerToSubnets, AWS::ELB::ConfigureHealthCheck, AWS::ELB::CreateLoadBalancer, AWS::ELB::DeleteLoadBalancer, AWS::ELB::DeregisterInstancesFromLoadBalancer, AWS::ELB::DescribeInstanceHealth, AWS::ELB::DescribeLoadBalancerPolicies, AWS::ELB::DescribeLoadBalancerPolicyTypes, AWS::ELB::DescribeLoadBalancers, AWS::ELB::DetachLoadBalancerFromSubnets, AWS::ELB::DisableAvailabilityZonesForLoadBalancer, AWS::ELB::Empty, AWS::ELB::EnableAvailabilityZonesForLoadBalancer, AWS::ELB::RegisterInstancesWithLoadBalancer, AWS::EMR::AddInstanceGroups, AWS::EMR::AddJobFlowSteps, AWS::EMR::DescribeJobFlows, AWS::EMR::ModifyInstanceGroups, AWS::EMR::RunJobFlow, AWS::EMR::SetTerminationProtection, AWS::EMR::TerminateJobFlows, AWS::ElasticBeanstalk::BaseParser, AWS::ElasticBeanstalk::Empty, AWS::Elasticache::Base, AWS::Elasticache::SecurityGroupParser, AWS::IAM::BaseInstanceProfile, AWS::IAM::Basic, AWS::IAM::CreateAccessKey, AWS::IAM::CreateGroup, AWS::IAM::CreateUser, AWS::IAM::GetGroup, AWS::IAM::GetGroupPolicy, AWS::IAM::GetRolePolicy, AWS::IAM::GetUser, AWS::IAM::GetUserPolicy, AWS::IAM::ListAccessKeys, AWS::IAM::ListAccountAliases, AWS::IAM::ListGroups, AWS::IAM::ListGroupsForUser, AWS::IAM::ListPolicies, AWS::IAM::ListServerCertificates, AWS::IAM::ListSigningCertificates, AWS::IAM::ListUsers, AWS::IAM::LoginProfile, AWS::IAM::RoleParser, AWS::IAM::UpdateGroup, AWS::IAM::UpdateUser, AWS::IAM::UploadServerCertificate, AWS::IAM::UploadSigningCertificate, AWS::RDS::CreateDbParameterGroup, AWS::RDS::DBEngineVersionParser, AWS::RDS::DbParser, AWS::RDS::DeleteDbParameterGroup, AWS::RDS::DescribeDBParameterGroups, AWS::RDS::DescribeDBParameters, AWS::RDS::DescribeDBReservedInstances, 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::SNS::AddPermission, AWS::SNS::ConfirmSubscription, AWS::SNS::CreateTopic, AWS::SNS::DeleteTopic, AWS::SNS::GetTopicAttributes, AWS::SNS::ListSubscriptions, AWS::SNS::ListTopics, AWS::SNS::Publish, AWS::SNS::RemovePermission, AWS::SNS::SetTopicAttributes, AWS::SNS::Subscribe, AWS::SNS::Unsubscribe, AWS::SQS::Basic, AWS::SQS::CreateQueue, AWS::SQS::GetQueueAttributes, AWS::SQS::ListQueues, AWS::SQS::ReceiveMessage, AWS::SQS::SendMessage, AWS::STS::GetSessionToken, AWS::SimpleDB::Basic, CDN::AWS::Distribution, CDN::AWS::GetDistributionList, CDN::AWS::GetInvalidationList, CDN::AWS::GetStreamingDistributionList, CDN::AWS::PostInvalidation, CDN::AWS::StreamingDistribution, Compute::AWS::AllocateAddress, Compute::AWS::AssociateAddress, Compute::AWS::AssociateDhcpOptions, Compute::AWS::AttachInternetGateway, Compute::AWS::AttachNetworkInterface, Compute::AWS::AttachVolume, Compute::AWS::Basic, Compute::AWS::CancelSpotInstanceRequests, Compute::AWS::CreateDhcpOptions, Compute::AWS::CreateImage, Compute::AWS::CreateInternetGateway, Compute::AWS::CreateKeyPair, Compute::AWS::CreateSecurityGroup, Compute::AWS::CreateSnapshot, Compute::AWS::CreateSubnet, Compute::AWS::CreateVolume, Compute::AWS::CreateVpc, Compute::AWS::DeleteDhcpOptions, Compute::AWS::DeleteInternetGateway, Compute::AWS::DeleteNetworkInterface, Compute::AWS::DeleteSubnet, Compute::AWS::DeleteVpc, Compute::AWS::DeregisterImage, Compute::AWS::DescribeAddresses, Compute::AWS::DescribeAvailabilityZones, Compute::AWS::DescribeDhcpOptions, Compute::AWS::DescribeImages, Compute::AWS::DescribeInstanceStatus, Compute::AWS::DescribeInstances, Compute::AWS::DescribeInternetGateways, Compute::AWS::DescribeKeyPairs, Compute::AWS::DescribePlacementGroups, Compute::AWS::DescribeRegions, Compute::AWS::DescribeReservedInstances, Compute::AWS::DescribeReservedInstancesOfferings, Compute::AWS::DescribeSecurityGroups, Compute::AWS::DescribeSnapshots, Compute::AWS::DescribeSpotPriceHistory, Compute::AWS::DescribeSubnets, Compute::AWS::DescribeTags, Compute::AWS::DescribeVolumeStatus, Compute::AWS::DescribeVolumes, Compute::AWS::DescribeVpcs, Compute::AWS::DetachInternetGateway, Compute::AWS::DetachNetworkInterface, Compute::AWS::DetachVolume, Compute::AWS::GetConsoleOutput, Compute::AWS::GetPasswordData, Compute::AWS::ImportKeyPair, Compute::AWS::MonitorUnmonitorInstances, Compute::AWS::NetworkInterfaceParser, Compute::AWS::PurchaseReservedInstancesOffering, Compute::AWS::RegisterImage, Compute::AWS::RunInstances, Compute::AWS::SpotDatafeedSubscription, Compute::AWS::SpotInstanceRequests, Compute::AWS::StartStopInstances, Compute::AWS::TerminateInstances, Compute::Voxel::Basic, Compute::Voxel::DevicesList, Compute::Voxel::ImagesList, Compute::Voxel::VoxcloudCreate, Compute::Voxel::VoxcloudDelete, Compute::Voxel::VoxcloudStatus, DNS::AWS::ChangeResourceRecordSets, DNS::AWS::CreateHostedZone, DNS::AWS::DeleteHostedZone, DNS::AWS::GetChange, DNS::AWS::GetHostedZone, DNS::AWS::ListHostedZones, DNS::AWS::ListResourceRecordSets, DNS::Bluebox::CreateRecord, DNS::Bluebox::CreateZone, DNS::Bluebox::GetRecord, DNS::Bluebox::GetRecords, DNS::Bluebox::GetZone, DNS::Bluebox::GetZones, DNS::Zerigo::CountHosts, DNS::Zerigo::CountZones, DNS::Zerigo::CreateHost, DNS::Zerigo::CreateZone, DNS::Zerigo::FindHosts, DNS::Zerigo::GetHost, DNS::Zerigo::GetZone, DNS::Zerigo::GetZoneStats, DNS::Zerigo::ListHosts, DNS::Zerigo::ListZones, Storage::AWS::AccessControlList, Storage::AWS::CompleteMultipartUpload, Storage::AWS::CopyObject, Storage::AWS::GetBucket, Storage::AWS::GetBucketLifecycle, Storage::AWS::GetBucketLocation, Storage::AWS::GetBucketLogging, Storage::AWS::GetBucketObjectVersions, Storage::AWS::GetBucketVersioning, Storage::AWS::GetBucketWebsite, Storage::AWS::GetRequestPayment, Storage::AWS::GetService, Storage::AWS::InitiateMultipartUpload, Storage::AWS::ListMultipartUploads, Storage::AWS::ListParts, Storage::Google::AccessControlList, Storage::Google::CopyObject, Storage::Google::GetBucket, Storage::Google::GetBucketObjectVersions, Storage::Google::GetBucketVersioning, Storage::Google::GetRequestPayment, Storage::Google::GetService, 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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeBase

Returns a new instance of Base.



9
10
11
# File 'lib/rackspace-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/rackspace-fog/core/parser.rb', line 7

def response
  @response
end

Instance Method Details

#attr_value(name, attrs) ⇒ Object



13
14
15
# File 'lib/rackspace-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/rackspace-fog/core/parser.rb', line 21

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

#resetObject



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

def reset
  @response = {}
end

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



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

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

#valueObject



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

def value
  @value && @value.dup
end