Class: Mo2tex::ExcludeDates
- Inherits:
-
ExcludeBase
- Object
- ExcludeBase
- Mo2tex::ExcludeDates
- Defined in:
- lib/mo2tex/exclude_date.rb
Instance Attribute Summary collapse
-
#end_date ⇒ Object
readonly
Returns the value of attribute end_date.
-
#start_date ⇒ Object
readonly
Returns the value of attribute start_date.
Attributes inherited from ExcludeBase
Instance Method Summary collapse
- #does_it_skip?(d) ⇒ Boolean
-
#initialize(sd, ed, sp, ep) ⇒ ExcludeDates
constructor
A new instance of ExcludeDates.
Methods inherited from ExcludeBase
Constructor Details
#initialize(sd, ed, sp, ep) ⇒ ExcludeDates
Returns a new instance of ExcludeDates.
54 55 56 57 58 59 60 |
# File 'lib/mo2tex/exclude_date.rb', line 54 def initialize(sd, ed, sp, ep) super(sp, ep) @start_date = DateTime.parse(sd.to_s) @end_date = DateTime.parse(ed.to_s) raise DateOutOfRange, self.start_date.to_s unless within_period?(self.start_date) raise DateOutOfRange, self.end_date.to_s unless within_period?(self.end_date) end |
Instance Attribute Details
#end_date ⇒ Object (readonly)
Returns the value of attribute end_date.
52 53 54 |
# File 'lib/mo2tex/exclude_date.rb', line 52 def end_date @end_date end |
#start_date ⇒ Object (readonly)
Returns the value of attribute start_date.
52 53 54 |
# File 'lib/mo2tex/exclude_date.rb', line 52 def start_date @start_date end |
Instance Method Details
#does_it_skip?(d) ⇒ Boolean
62 63 64 |
# File 'lib/mo2tex/exclude_date.rb', line 62 def does_it_skip?(d) return (d >= self.start_date && d <= self.end_date) end |