Class: Cronos::TaskInterval

Inherits:
Interval show all
Defined in:
lib/cronos.rb

Constant Summary

Constants inherited from Interval

Interval::DAYS, Interval::MONTHS

Instance Attribute Summary collapse

Attributes inherited from Interval

#day, #dow, #hour, #min, #month

Instance Method Summary collapse

Methods inherited from Interval

#at, #daily, #days, #every, #hourly, #midday, #midnight, #monthly, #of, #on, #weekdays, #weekends, #weekly

Constructor Details

#initialize(task) ⇒ TaskInterval

Returns a new instance of TaskInterval.



312
313
314
# File 'lib/cronos.rb', line 312

def initialize(task)
  @task = task
end

Instance Attribute Details

#taskObject

Returns the value of attribute task.



310
311
312
# File 'lib/cronos.rb', line 310

def task
  @task
end

Instance Method Details

#to_hashObject



320
321
322
# File 'lib/cronos.rb', line 320

def to_hash
  super.merge(:command => task)
end

#to_sObject



316
317
318
# File 'lib/cronos.rb', line 316

def to_s
  "#{super} #{@task}"
end