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.



441
442
443
444
445
446
447
448
449
450
451
452
453
454
# File 'lib/td/client/model.rb', line 441

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
end

Instance Attribute Details

#cronObject (readonly)

Returns the value of attribute cron.



456
457
458
# File 'lib/td/client/model.rb', line 456

def cron
  @cron
end

#databaseObject (readonly)

Returns the value of attribute database.



456
457
458
# File 'lib/td/client/model.rb', line 456

def database
  @database
end

#delayObject (readonly)

Returns the value of attribute delay.



456
457
458
# File 'lib/td/client/model.rb', line 456

def delay
  @delay
end

#nameObject (readonly)

Returns the value of attribute name.



456
457
458
# File 'lib/td/client/model.rb', line 456

def name
  @name
end

#org_nameObject (readonly)

Returns the value of attribute org_name.



456
457
458
# File 'lib/td/client/model.rb', line 456

def org_name
  @org_name
end

#priorityObject (readonly)

Returns the value of attribute priority.



456
457
458
# File 'lib/td/client/model.rb', line 456

def priority
  @priority
end

#queryObject (readonly)

Returns the value of attribute query.



456
457
458
# File 'lib/td/client/model.rb', line 456

def query
  @query
end

#result_urlObject (readonly)

Returns the value of attribute result_url.



456
457
458
# File 'lib/td/client/model.rb', line 456

def result_url
  @result_url
end

#retry_limitObject (readonly)

Returns the value of attribute retry_limit.



456
457
458
# File 'lib/td/client/model.rb', line 456

def retry_limit
  @retry_limit
end

#timezoneObject (readonly)

Returns the value of attribute timezone.



456
457
458
# File 'lib/td/client/model.rb', line 456

def timezone
  @timezone
end

Instance Method Details

#next_timeObject



458
459
460
# File 'lib/td/client/model.rb', line 458

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

#run(time, num) ⇒ Object



462
463
464
# File 'lib/td/client/model.rb', line 462

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