Class: Cronex::MonthDescription

Inherits:
Description show all
Defined in:
lib/cronex/description/month.rb

Instance Attribute Summary

Attributes inherited from Description

#options, #resources

Instance Method Summary collapse

Methods inherited from Description

#initialize, #plural, #segment_description, #special_chars

Constructor Details

This class inherits a constructor from Cronex::Description

Instance Method Details

#between_description_format(expression) ⇒ Object



11
12
13
# File 'lib/cronex/description/month.rb', line 11

def between_description_format(expression)
  ', ' + resources.get('between_description_format')
end

#description_format(expression) ⇒ Object



15
16
17
# File 'lib/cronex/description/month.rb', line 15

def description_format(expression)
  ', ' + resources.get('only_in')
end

#interval_description_format(expression) ⇒ Object



7
8
9
# File 'lib/cronex/description/month.rb', line 7

def interval_description_format(expression)
  format(', ' + resources.get('every_x') + ' ' + plural(expression, resources.get('month'), resources.get('months')), expression)
end

#single_item_description(expression) ⇒ Object



3
4
5
# File 'lib/cronex/description/month.rb', line 3

def single_item_description(expression)
  resources.get(DateTime.new(Time.now.year, Cronex::Utils.integer(expression), 1).strftime('%B').downcase)
end

#starting_description_format(expression) ⇒ Object



19
20
21
# File 'lib/cronex/description/month.rb', line 19

def starting_description_format(expression)
  resources.get('starting') + ' ' + resources.get('in_x')
end