Sha256: 635380df2f59b6e159238956f6bba44db5209f36897b6e74a87439b26505f645

Contents?: true

Size: 745 Bytes

Versions: 54

Compression:

Stored size: 745 Bytes

Contents

class Ey::Core::Client::Task < Ey::Core::Model
  extend Ey::Core::Associations
  include Ey::Core::Subscribable

  identity :id

  attribute :action
  attribute :configuration
  attribute :created_at, type: :time
  attribute :finished_at, type: :time
  attribute :message
  attribute :started_at, type: :time
  attribute :successful, type: :boolean
  attribute :updated_at, type: :time

  has_one :application_deployment
  has_one :schedule

  has_many :component_actions

  def ready?
    !!finished_at
  end

  def save!
    params = {
      "url" => self.collection.url,
    }

    if new_record?
      connection.requests.new(self.connection.create_task(params).body["request"])
    else raise NotImplementedError # update
    end
  end
end

Version data entries

54 entries across 54 versions & 3 rubygems

Version Path
ey-pro-cli-0.0.16 lib/vendor/core/ey-core/models/task.rb
ey-pro-cli-0.0.15 lib/vendor/core/ey-core/models/task.rb
ey-pro-cli-0.0.14 lib/vendor/core/ey-core/models/task.rb
ey-pro-cli-0.0.13 lib/vendor/core/ey-core/models/task.rb
ey-pro-cli-0.0.12 lib/vendor/core/ey-core/models/task.rb
ey-pro-cli-0.0.11 lib/vendor/core/ey-core/models/task.rb
ey-pro-cli-0.0.10 lib/vendor/core/ey-core/models/task.rb
ey-pro-cli-0.0.9 lib/vendor/core/ey-core/models/task.rb
ey-pro-cli-0.0.8 lib/vendor/core/ey-core/models/task.rb
ey-pro-cli-0.0.7 lib/vendor/core/ey-core/models/task.rb
ey-pro-cli-0.0.6 lib/vendor/core/ey-core/models/task.rb
ey-pro-cli-0.0.5 lib/vendor/core/ey-core/models/task.rb
ey-pro-cli-0.0.4 lib/vendor/core/ey-core/models/task.rb
ey-pro-cli-0.0.3 lib/vendor/core/ey-core/models/task.rb