Sha256: 6a7738ea69caa513434836ac8770fac8243f9198ec2a8e2a4072247182698cb1

Contents?: true

Size: 854 Bytes

Versions: 22

Compression:

Stored size: 854 Bytes

Contents

require 'fog/model'

module Fog
  module Terremark
    module Shared

      class Task < Fog::Model

        identity :id

        attribute :end_time,    'endTime'
        attribute :owner,       'Owner'
        attribute :result,      'Result'
        attribute :start_time,  'startTime'
        attribute :status

        def initialize(attributes = {})
          new_owner  = attributes.delete('Owner')
          new_result = attributes.delete('Result')
          super
          @owner  = connection.parse(new_owner)
          if new_result
            @result = connection.parse(new_result)
          end
        end

        def ready?
          @status == 'success'
        end

        private

        def href=(new_href)
          @id = new_href.split('/').last.to_i
        end

        def type=(new_type); end

      end

    end
  end
end

Version data entries

22 entries across 22 versions & 1 rubygems

Version Path
fog-0.0.99 lib/fog/terremark/models/shared/task.rb
fog-0.0.98 lib/fog/terremark/models/shared/task.rb
fog-0.0.97 lib/fog/terremark/models/shared/task.rb
fog-0.0.96 lib/fog/terremark/models/shared/task.rb
fog-0.0.95 lib/fog/terremark/models/shared/task.rb
fog-0.0.94 lib/fog/terremark/models/shared/task.rb
fog-0.0.93 lib/fog/terremark/models/shared/task.rb
fog-0.0.92 lib/fog/terremark/models/shared/task.rb
fog-0.0.91 lib/fog/terremark/models/shared/task.rb
fog-0.0.90 lib/fog/terremark/models/shared/task.rb
fog-0.0.89 lib/fog/terremark/models/shared/task.rb
fog-0.0.88 lib/fog/terremark/models/shared/task.rb
fog-0.0.87 lib/fog/terremark/models/shared/task.rb
fog-0.0.86 lib/fog/terremark/models/shared/task.rb
fog-0.0.85 lib/fog/terremark/models/shared/task.rb
fog-0.0.84 lib/fog/terremark/models/shared/task.rb
fog-0.0.83 lib/fog/terremark/models/shared/task.rb
fog-0.0.82 lib/fog/terremark/models/shared/task.rb
fog-0.0.81 lib/fog/terremark/models/shared/task.rb
fog-0.0.80 lib/fog/terremark/models/shared/task.rb