Sha256: 387a64afb600c3822a801ea8d0077051f2424490c2ab5a90209de78c407f9f05

Contents?: true

Size: 868 Bytes

Versions: 1

Compression:

Stored size: 868 Bytes

Contents

module Fog
  module Parsers
    module AWS
      module Elasticache
        require 'rackspace-fog/aws/parsers/elasticache/base'

        class EventListParser < Base

          def reset
            super
            @response['Events'] = []
          end

          def start_element(name, attrs = [])
            super
            case name
            when 'Event'; then @event = {}
            end

          end

          def end_element(name)
            case name
            when 'Date'
              @event[name] = DateTime.parse(value.strip)
            when 'Message', 'SourceIdentifier', 'SourceType'
              @event[name] = value ? value.strip : name
            when 'Event'
              @response['Events'] << @event unless @event.empty?
            else
              super
            end
          end
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
rackspace-fog-1.4.2 lib/rackspace-fog/aws/parsers/elasticache/event_list.rb