Sha256: 5a474ad9fb406bb40bc5ceb25d62339cacae395fbf9caab0169bce0c06df9d84

Contents?: true

Size: 652 Bytes

Versions: 6

Compression:

Stored size: 652 Bytes

Contents

require 'schedule_attributes/time_helpers'

module ScheduleAttributes
  module RuleParser
    TimeHelpers = ScheduleAttributes::TimeHelpers

    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

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

  end
end

require 'schedule_attributes/rule_parser/base'
require 'schedule_attributes/rule_parser/day'
require 'schedule_attributes/rule_parser/week'
require 'schedule_attributes/rule_parser/month'
require 'schedule_attributes/rule_parser/year'

Version data entries

6 entries across 6 versions & 2 rubygems

Version Path
dgp-schedule_attributes-0.5.3 lib/schedule_attributes/rule_parser.rb
dgp-schedule_attributes-0.5.2 lib/schedule_attributes/rule_parser.rb
dgp-schedule_attributes-0.5.1 lib/schedule_attributes/rule_parser.rb
dgp-schedule_attributes-0.5.0 lib/schedule_attributes/rule_parser.rb
dgp-schedule_attributes-0.4.0 lib/schedule_attributes/rule_parser.rb
schedule_attributes-0.3.0 lib/schedule_attributes/rule_parser.rb