Class: Ey::Core::Client::Task

Inherits:
Model
  • Object
show all
Extended by:
Associations
Includes:
Subscribable
Defined in:
lib/vendor/core/ey-core/models/task.rb

Instance Method Summary collapse

Methods included from Associations

assoc_accessor, assoc_coverage, assoc_reader, assoc_writer, associations, collection_reader

Methods included from Subscribable

included, #read_channel_uri, #subscribe

Methods inherited from Model

#destroy, range_parser, #save, #update!, #url

Instance Method Details

#ready?Boolean

Returns:

  • (Boolean)


21
22
23
# File 'lib/vendor/core/ey-core/models/task.rb', line 21

def ready?
  !!finished_at
end

#save!Object



25
26
27
28
29
30
31
32
33
34
# File 'lib/vendor/core/ey-core/models/task.rb', line 25

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