Class: Cronscription::Tab
- Inherits:
-
Object
- Object
- Cronscription::Tab
- Defined in:
- lib/cronscription/tab.rb
Instance Method Summary collapse
- #==(other) ⇒ Object
- #find(regex) ⇒ Object
-
#initialize(cron_lines) ⇒ Tab
constructor
A new instance of Tab.
- #sorted_merge(*arrs) ⇒ Object
- #times_to_execute(regex, start, finish) ⇒ Object
Constructor Details
Instance Method Details
#==(other) ⇒ Object
11 12 13 |
# File 'lib/cronscription/tab.rb', line 11 def ==(other) @entries == other.instance_variable_get(:@entries) end |
#find(regex) ⇒ Object
15 16 17 |
# File 'lib/cronscription/tab.rb', line 15 def find(regex) @entries.select{|e| e.match_command?(regex)} end |
#sorted_merge(*arrs) ⇒ Object
19 20 21 |
# File 'lib/cronscription/tab.rb', line 19 def sorted_merge(*arrs) arrs.flatten.uniq.sort end |
#times_to_execute(regex, start, finish) ⇒ Object
23 24 25 |
# File 'lib/cronscription/tab.rb', line 23 def times_to_execute(regex, start, finish) sorted_merge(find(regex).map{|e| e.times_to_execute(start, finish)}) end |