Class: Mo2tex::ExcludeBase
- Inherits:
-
Object
- Object
- Mo2tex::ExcludeBase
- Defined in:
- lib/mo2tex/exclude_date.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#end_period ⇒ Object
readonly
Returns the value of attribute end_period.
-
#start_period ⇒ Object
readonly
Returns the value of attribute start_period.
Instance Method Summary collapse
-
#initialize(sp, ep) ⇒ ExcludeBase
constructor
A new instance of ExcludeBase.
- #skip?(d) ⇒ Boolean
Constructor Details
#initialize(sp, ep) ⇒ ExcludeBase
Returns a new instance of ExcludeBase.
11 12 13 14 |
# File 'lib/mo2tex/exclude_date.rb', line 11 def initialize(sp, ep) @start_period = DateTime.parse(sp.to_s) @end_period = DateTime.parse(ep.to_s) end |
Instance Attribute Details
#end_period ⇒ Object (readonly)
Returns the value of attribute end_period.
9 10 11 |
# File 'lib/mo2tex/exclude_date.rb', line 9 def end_period @end_period end |
#start_period ⇒ Object (readonly)
Returns the value of attribute start_period.
9 10 11 |
# File 'lib/mo2tex/exclude_date.rb', line 9 def start_period @start_period end |
Instance Method Details
#skip?(d) ⇒ Boolean
16 17 18 19 20 |
# File 'lib/mo2tex/exclude_date.rb', line 16 def skip?(d) dt = DateTime.parse(d.to_s) return true unless within_period?(dt) return does_it_skip?(dt) end |