Class: Mo2tex::ExcludeBase

Inherits:
Object
  • Object
show all
Defined in:
lib/mo2tex/exclude_date.rb

Direct Known Subclasses

ExcludeDate, ExcludeDates

Instance Attribute Summary collapse

Instance Method Summary collapse

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_periodObject (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_periodObject (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

Returns:

  • (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