Class: Clavius::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/clavius/configuration.rb

Defined Under Namespace

Classes: Raw

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

Returns a new instance of Configuration.



6
7
8
# File 'lib/clavius/configuration.rb', line 6

def initialize
  @raw = Raw.new.tap do |raw| yield raw if block_given? end
end

Instance Method Details

#excludedObject



25
26
27
# File 'lib/clavius/configuration.rb', line 25

def excluded
  @excluded ||= exception_configuration(raw.excluded)
end

#includedObject



21
22
23
# File 'lib/clavius/configuration.rb', line 21

def included
  @included ||= exception_configuration(raw.included)
end

#weekdaysObject



10
11
12
13
14
15
16
17
18
19
# File 'lib/clavius/configuration.rb', line 10

def weekdays
  @weekdays ||= begin
    raw
      .weekdays
      .select { |weekday| Time::WEEKDAYS.include?(weekday) }
      .map    { |weekday| Time::WEEKDAYS.index(weekday) }
      .to_set
      .freeze
  end
end