lib/mergent/task.rb in mergent-0.2.2 vs lib/mergent/task.rb in mergent-1.0.0
- old
+ new
@@ -3,19 +3,22 @@
require_relative "client"
require_relative "object"
module Mergent
class Task < Mergent::Object
- ATTRS = %i[name description status request scheduled_for created_at].freeze
+ ATTRS = %i[id name queue status request scheduled_for created_at].freeze
ATTRS.each do |name|
define_method(name) do
@_data[name]
end
end
def self.create(params = {})
- data = Client.post("tasks", params)
+ data = Client.post(
+ "tasks",
+ { queue: Mergent::Object::DEFAULT_QUEUE }.merge(params)
+ )
new(data)
end
end
end