Sha256: 2a9dc098838e8e7a10dd85479c6180f6cc02cfc1659043fdd33d86ef9971639f

Contents?: true

Size: 1 KB

Versions: 126

Compression:

Stored size: 1 KB

Contents

module Fog
  module Parsers
    module Compute
      module Voxel
        class VoxcloudStatus < Fog::Parsers::Base
          def reset
            @response = { 'devices' => [] }
            @device = {}
          end

          def start_element(name, attrs = [])
            super

            case name
            when 'rsp'
              @response['stat'] = attr_value('stat', attrs)
            when 'err'
              @response['err'] = {
                'code'  => attr_value('code', attrs),
                'msg'   => attr_value('msg', attrs)
              }
            when 'device'
              @device = {}
            end
          end

          def end_element(name)
            case name
            when 'device'
              @response['devices'] << @device
              @device = {}
            when 'id', 'status'
              @device[name] = value
            when 'last_update'
              @device[name] = Time.at(value.to_i)
            end
          end
        end
      end
    end
  end
end

Version data entries

126 entries across 126 versions & 22 rubygems

Version Path
vagrant-cloudstack-1.1.0 vendor/bundle/gems/fog-1.22.1/lib/fog/voxel/parsers/compute/voxcloud_status.rb
fog-voxel-0.0.2 lib/fog/parsers/compute/voxel/voxcloud_status.rb
fog-voxel-0.0.1 lib/fog/parsers/compute/voxel/voxcloud_status.rb
fog-1.24.0 lib/fog/voxel/parsers/compute/voxcloud_status.rb
ns-fog-1.22.11 lib/fog/voxel/parsers/compute/voxcloud_status.rb
ns-fog-1.22.10 lib/fog/voxel/parsers/compute/voxcloud_status.rb
ns-fog-1.22.9 lib/fog/voxel/parsers/compute/voxcloud_status.rb
ns-fog-1.22.8 lib/fog/voxel/parsers/compute/voxcloud_status.rb
ns-fog-1.22.7 lib/fog/voxel/parsers/compute/voxcloud_status.rb
ns-fog-1.22.6 lib/fog/voxel/parsers/compute/voxcloud_status.rb
fog-1.23.0 lib/fog/voxel/parsers/compute/voxcloud_status.rb
ns-fog-1.22.4 lib/fog/voxel/parsers/compute/voxcloud_status.rb
ns-fog-1.22.3 lib/fog/voxel/parsers/compute/voxcloud_status.rb
ns-fog-1.22.2 lib/fog/voxel/parsers/compute/voxcloud_status.rb
fog-1.22.1 lib/fog/voxel/parsers/compute/voxcloud_status.rb
fog-1.22.0 lib/fog/voxel/parsers/compute/voxcloud_status.rb
fog-1.21.0 lib/fog/voxel/parsers/compute/voxcloud_status.rb
fog-maestrodev-1.20.0.20140305101839 lib/fog/voxel/parsers/compute/voxcloud_status.rb
fog-maestrodev-1.20.0.20140305101305 lib/fog/voxel/parsers/compute/voxcloud_status.rb
fog-maestrodev-1.19.0.20140212012611 lib/fog/voxel/parsers/compute/voxcloud_status.rb