Class: Aws::AcfInterface::AcfBaseDistributionParser

Inherits:
Aws::AwsParser show all
Defined in:
lib/acf/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:



356
357
358
359
# File 'lib/acf/acf_interface.rb', line 356

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

#tagend(name) ⇒ Object



361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
# File 'lib/acf/acf_interface.rb', line 361

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