Class: Aws::AcfInterface::AcfBaseDistributionParser

Inherits:
Aws::AwsParser show all
Defined in:
lib/acf/right_acf_interface.rb

Overview

Parses attributes common to many CF distribution API calls

Constant Summary

Constants inherited from Aws::AwsParser

Aws::AwsParser::DEFAULT_XML_LIBRARY

Instance Attribute Summary

Attributes inherited from Aws::AwsParser

#result, #xml_lib, #xmlpath

Instance Method Summary collapse

Methods inherited from Aws::AwsParser

#initialize, #method_missing, #parse, #tag_end, #tag_start, #tagstart, #tagtext, #text, xml_lib, xml_lib=

Constructor Details

This class inherits a constructor from Aws::AwsParser

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Aws::AwsParser

Instance Method Details

#resetObject

:nodoc:



346
347
348
349
# File 'lib/acf/right_acf_interface.rb', line 346

def reset
  @distribution = { :cnames => [] }
  @result = []
end

#tagend(name) ⇒ Object



350
351
352
353
354
355
356
357
358
359
360
361
362
# File 'lib/acf/right_acf_interface.rb', line 350

def tagend(name)
  case name
    when 'Id'               then @distribution[:aws_id]             = @text
    when 'Status'           then @distribution[:status]             = @text
    when 'LastModifiedTime' then @distribution[:last_modified_time] = Time.parse(@text)
    when 'DomainName'       then @distribution[:domain_name]        = @text
    when 'Origin'           then @distribution[:origin]             = @text
    when 'CallerReference'  then @distribution[:caller_reference]   = @text
    when 'Comment'          then @distribution[:comment]            = AcfInterface::unescape(@text)
    when 'Enabled'          then @distribution[:enabled]            = @text == 'true' ? true : false
    when 'CNAME'            then @distribution[:cnames]            << @text
  end
end