Class: TExp::MonthInterval

Inherits:
DayInterval show all
Defined in:
lib/texp/month_interval.rb

Instance Attribute Summary

Attributes inherited from DayInterval

#base_date, #interval

Instance Method Summary collapse

Methods inherited from DayInterval

#encode, #includes?, #initialize, parse_callback, #reanchor

Methods inherited from Base

#*, #+, #-, #-@, #each, #first_day_of_window, #include?, #last_day_of_window, parse_callback, #reanchor, register_parse_callback, #to_s, #window

Constructor Details

This class inherits a constructor from TExp::DayInterval

Instance Method Details

#day_multiplierObject



5
6
7
# File 'lib/texp/month_interval.rb', line 5

def day_multiplier
  28
end

#inspectObject



13
14
15
16
17
18
19
20
21
22
23
24
25
# File 'lib/texp/month_interval.rb', line 13

def inspect
  case interval
  when 1
    "once per month"
  when 0.5
    base = "twice per month"
  when 0.25
    base = "4 times per month"
  else
    base = super
  end
  base + " (#{interval * day_multiplier} days)"
end

#interval_unitObject



9
10
11
# File 'lib/texp/month_interval.rb', line 9

def interval_unit
  "month"
end