Sha256: 1a547d73aa104d6ebaefea419cad87eddf500ebbc75d9a358cc6792349c71e0b

Contents?: true

Size: 988 Bytes

Versions: 50

Compression:

Stored size: 988 Bytes

Contents

module Fog
  module Parsers
    module AWS
      module Compute

        class StartStopInstances < Fog::Parsers::Base

          def reset
            @instance = { 'currentState' => {}, 'previousState' => {} }
            @response = { 'instancesSet' => [] }
            @state = nil
          end

          def start_element(name, attrs = [])
            super
            case name
            when 'currentState', 'previousState'
              @state = name
            end
          end

          def end_element(name)
            case name
            when 'code'
              @instance[@state][name] = @value.to_s
            when 'instanceId'
              @instance[name] = @value
            when 'item'
              @response['instancesSet'] << @instance
              @instance = { 'currentState' => {}, 'previousState' => {} }
            when 'name'
              @instance[@state][name] = @value
            end
          end

        end

      end
    end
  end
end

Version data entries

50 entries across 50 versions & 3 rubygems

Version Path
fog-0.3.28 lib/fog/aws/parsers/compute/start_stop_instances.rb
fog-0.3.27 lib/fog/aws/parsers/compute/start_stop_instances.rb
fog-0.3.26 lib/fog/aws/parsers/compute/start_stop_instances.rb
fog-0.3.25 lib/fog/aws/parsers/compute/start_stop_instances.rb
fog-0.3.24 lib/fog/aws/parsers/compute/start_stop_instances.rb
bbcloud-0.8.1 lib/bbcloud/vendor/fog-0.3.23/lib/fog/aws/parsers/compute/start_stop_instances.rb
fog-0.3.23 lib/fog/aws/parsers/compute/start_stop_instances.rb
fog-0.3.22 lib/fog/aws/parsers/compute/start_stop_instances.rb
fog-0.3.21 lib/fog/aws/parsers/compute/start_stop_instances.rb
fog-0.3.20 lib/fog/aws/parsers/compute/start_stop_instances.rb
fog-0.3.19 lib/fog/aws/parsers/compute/start_stop_instances.rb
fog-0.3.18 lib/fog/aws/parsers/compute/start_stop_instances.rb
fog-0.3.17 lib/fog/aws/parsers/compute/start_stop_instances.rb
fog-0.3.16 lib/fog/aws/parsers/compute/start_stop_instances.rb
fog-0.3.15 lib/fog/aws/parsers/compute/start_stop_instances.rb
fog-0.3.14 lib/fog/aws/parsers/compute/start_stop_instances.rb
fog-0.3.13 lib/fog/aws/parsers/compute/start_stop_instances.rb
fog-0.3.12 lib/fog/aws/parsers/compute/start_stop_instances.rb
fog-0.3.11 lib/fog/aws/parsers/compute/start_stop_instances.rb
fog-0.3.10 lib/fog/aws/parsers/compute/start_stop_instances.rb