Class: CrontabAsterisk

Inherits:
AbstractCrontabField show all
Defined in:
lib/crontab_fields.rb

Instance Method Summary collapse

Methods inherited from AbstractCrontabField

create_from_string

Constructor Details

#initialize(step = nil) ⇒ CrontabAsterisk

Returns a new instance of CrontabAsterisk.



42
43
44
# File 'lib/crontab_fields.rb', line 42

def initialize(step=nil)
  step.nil? ? @step = 1 : @step = step.to_i
end

Instance Method Details

#to_sObject



45
46
47
48
49
# File 'lib/crontab_fields.rb', line 45

def to_s
  as_s = '*'
  as_s += "/#{@step}" if @step > 1
  as_s
end