Class: ScheduleAttributes::RuleParser::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/schedule_attributes/rule_parser/base.rb

Direct Known Subclasses

Day, Month, Week, Year

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(input) ⇒ Base

Returns a new instance of Base.

Parameters:

  • options (Hash)


5
6
7
8
9
# File 'lib/schedule_attributes/rule_parser/base.rb', line 5

def initialize(input)
  @input = input
  @rule ||= rule_factory.daily(input.interval)
  @exceptions ||= []
end

Instance Attribute Details

#inputObject (readonly)

Returns the value of attribute input.



11
12
13
# File 'lib/schedule_attributes/rule_parser/base.rb', line 11

def input
  @input
end

Instance Method Details

#exceptionsObject



21
22
23
24
25
# File 'lib/schedule_attributes/rule_parser/base.rb', line 21

def exceptions
  set_yearly_month_exceptions

  @exceptions
end

#ruleObject



13
14
15
16
17
18
19
# File 'lib/schedule_attributes/rule_parser/base.rb', line 13

def rule
  parse_options
  set_end_date
  set_yearly_months

  @rule
end