Module: ScheduleAttributes::RuleParser

Defined in:
lib/schedule_attributes/rule_parser.rb,
lib/schedule_attributes/rule_parser/day.rb,
lib/schedule_attributes/rule_parser/base.rb,
lib/schedule_attributes/rule_parser/week.rb,
lib/schedule_attributes/rule_parser/year.rb,
lib/schedule_attributes/rule_parser/month.rb

Defined Under Namespace

Classes: Base, Day, Month, Week, Year

Constant Summary collapse

TimeHelpers =
ScheduleAttributes::TimeHelpers

Class Method Summary collapse

Class Method Details

.[](interval) ⇒ Object



7
8
9
10
11
12
# File 'lib/schedule_attributes/rule_parser.rb', line 7

def self.[](interval)
  parser_name = interval.to_s.capitalize
  if parser_name.present? && RuleParser.const_defined?(parser_name)
    RuleParser.const_get parser_name
  end
end

.parse(options) ⇒ Object



14
15
16
# File 'lib/schedule_attributes/rule_parser.rb', line 14

def self.parse(options)
  new(options).parse
end