Class: CronComment

Inherits:
String
  • Object
show all
Defined in:
lib/khronotab/cron_comment.rb

Constant Summary collapse

COMMENT_REGEX =
%r{\s*#.*}i

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.matches?(cron_entry) ⇒ Boolean

Returns:

  • (Boolean)


5
6
7
# File 'lib/khronotab/cron_comment.rb', line 5

def self.matches?(cron_entry)
  !!COMMENT_REGEX.match(cron_entry)
end

Instance Method Details

#to_lineObject



13
14
15
# File 'lib/khronotab/cron_comment.rb', line 13

def to_line
  puts self
end

#to_sObject



9
10
11
# File 'lib/khronotab/cron_comment.rb', line 9

def to_s
  puts self
end