Class: TreasureData::Schedule

Inherits:
Model
  • Object
show all
Defined in:
lib/td/client/model.rb

Instance Attribute Summary collapse

Attributes inherited from Model

#client

Instance Method Summary collapse

Constructor Details

#initialize(client, name, cron, query, database = nil, result_url = nil, timezone = nil, delay = nil, next_time = nil, priority = nil, retry_limit = nil, org_name = nil) ⇒ Schedule

Returns a new instance of Schedule.



384
385
386
387
388
389
390
391
392
393
394
395
396
397
# File 'lib/td/client/model.rb', line 384

def initialize(client, name, cron, query, database=nil, result_url=nil, timezone=nil, delay=nil, next_time=nil, priority=nil, retry_limit=nil, org_name=nil)
  super(client)
  @name = name
  @cron = cron
  @query = query
  @database = database
  @result_url = result_url
  @timezone = timezone
  @delay = delay
  @next_time = next_time
  @priority = priority
  @retry_limit = retry_limit
  @org_name = org_name
end

Instance Attribute Details

#cronObject (readonly)

Returns the value of attribute cron.



399
400
401
# File 'lib/td/client/model.rb', line 399

def cron
  @cron
end

#databaseObject (readonly)

Returns the value of attribute database.



399
400
401
# File 'lib/td/client/model.rb', line 399

def database
  @database
end

#delayObject (readonly)

Returns the value of attribute delay.



399
400
401
# File 'lib/td/client/model.rb', line 399

def delay
  @delay
end

#nameObject (readonly)

Returns the value of attribute name.



399
400
401
# File 'lib/td/client/model.rb', line 399

def name
  @name
end

#org_nameObject (readonly)

Returns the value of attribute org_name.



399
400
401
# File 'lib/td/client/model.rb', line 399

def org_name
  @org_name
end

#priorityObject (readonly)

Returns the value of attribute priority.



399
400
401
# File 'lib/td/client/model.rb', line 399

def priority
  @priority
end

#queryObject (readonly)

Returns the value of attribute query.



399
400
401
# File 'lib/td/client/model.rb', line 399

def query
  @query
end

#result_urlObject (readonly)

Returns the value of attribute result_url.



399
400
401
# File 'lib/td/client/model.rb', line 399

def result_url
  @result_url
end

#retry_limitObject (readonly)

Returns the value of attribute retry_limit.



399
400
401
# File 'lib/td/client/model.rb', line 399

def retry_limit
  @retry_limit
end

#timezoneObject (readonly)

Returns the value of attribute timezone.



399
400
401
# File 'lib/td/client/model.rb', line 399

def timezone
  @timezone
end

Instance Method Details

#next_timeObject



401
402
403
# File 'lib/td/client/model.rb', line 401

def next_time
  @next_time ? Time.parse(@next_time) : nil
end

#run(time, num) ⇒ Object



405
406
407
# File 'lib/td/client/model.rb', line 405

def run(time, num)
  @client.run_schedule(time, num)
end