class Todoist::Command
Attributes
object[RW]
temp_id[RW]
type[RW]
uuid[RW]
Public Class Methods
new(type, object, temp_id = nil, uuid = nil)
click to toggle source
# File lib/todoist/command.rb, line 5 def initialize(type, object, temp_id = nil, uuid = nil) @type = type @object = object @temp_id = object.is_a?(Todoist::Resource) ? object.temp_id : temp_id @uuid = uuid || SecureRandom.uuid end
Public Instance Methods
arguments()
click to toggle source
# File lib/todoist/command.rb, line 12 def arguments object.is_a?(Todoist::Resource) ? object.to_submittable_hash : object end
to_hash()
click to toggle source
# File lib/todoist/command.rb, line 16 def to_hash { type: type, uuid: uuid, args: arguments }.merge(temp_id ? { temp_id: temp_id} : {}) end