Class: RightAws::AcfInterface::AcfInvalidationsListParser

Inherits:
RightAWSParser
  • Object
show all
Defined in:
lib/acf/right_acf_invalidations.rb

Overview


PARSERS:

Constant Summary

Constant Summary

Constants inherited from RightAWSParser

RightAWSParser::DEFAULT_XML_LIBRARY

Instance Attribute Summary

Attributes inherited from RightAWSParser

#full_tag_name, #result, #tag, #xml_lib, #xmlpath

Instance Method Summary (collapse)

Methods inherited from RightAWSParser

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

Constructor Details

This class inherits a constructor from RightAws::RightAWSParser

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class RightAws::RightAWSParser

Instance Method Details

- (Object) reset

:nodoc:



116
117
118
# File 'lib/acf/right_acf_invalidations.rb', line 116

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

- (Object) tagend(name)



125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
# File 'lib/acf/right_acf_invalidations.rb', line 125

def tagend(name)
  case name
  when 'Marker'      then @result[:marker]       = @text
  when 'NextMarker'  then @result[:next_marker]  = @text
  when 'MaxItems'    then @result[:max_items]    = @text.to_i
  when 'IsTruncated' then @result[:is_truncated] = (@text == 'true')
  when 'Id'              then @item[:aws_id]                                = @text
  when 'Status'          then @item[:status]                                = @text
  when 'CreateTime'      then @item[:create_time]                           = @text
  when 'Path'            then (@item[:invalidation_batch][:path] ||= [])   << @text
  when 'CallerReference' then @item[:invalidation_batch][:caller_reference] = @text
  when %r{(InvalidationSummary|Invalidation)$}
    @item[:invalidation_batch][:path].sort! if @item[:invalidation_batch] && !@item[:invalidation_batch][:path].right_blank?
    @result[:invalidations] << @item
  end
end

- (Object) tagstart(name, attributes)



119
120
121
122
123
124
# File 'lib/acf/right_acf_invalidations.rb', line 119

def tagstart(name, attributes)
  case name
  when %r{(InvalidationSummary|Invalidation)$} then @item = {}
  when %r{InvalidationBatch}                   then @item[:invalidation_batch] = {}
  end
end