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-core-3.6.0.autoscaling1 lib/ey-core/models/task.rb
ey-core-3.6.4 lib/ey-core/models/task.rb
ey-core-3.6.3 lib/ey-core/models/task.rb
ey-core-3.6.1 lib/ey-core/models/task.rb
groove-ey-core-3.6.3 lib/ey-core/models/task.rb
groove-ey-core-3.6.2 lib/ey-core/models/task.rb
groove-ey-core-3.6.1 lib/ey-core/models/task.rb
ey-core-3.5.0 lib/ey-core/models/task.rb
ey-core-3.4.4 lib/ey-core/models/task.rb
ey-core-3.4.2 lib/ey-core/models/task.rb
ey-core-3.4.1 lib/ey-core/models/task.rb
ey-core-3.4.0 lib/ey-core/models/task.rb
ey-core-3.3.1 lib/ey-core/models/task.rb
ey-core-3.3.0 lib/ey-core/models/task.rb
ey-core-3.2.6 lib/ey-core/models/task.rb
ey-core-3.2.5 lib/ey-core/models/task.rb
ey-core-3.2.4 lib/ey-core/models/task.rb
ey-core-3.2.3 lib/ey-core/models/task.rb
ey-core-3.2.2 lib/ey-core/models/task.rb
ey-core-3.2.1 lib/ey-core/models/task.rb