Class: Clavius::Configuration
- Inherits:
-
Object
- Object
- Clavius::Configuration
- Includes:
- Memoizable
- Defined in:
- lib/clavius/configuration.rb
Defined Under Namespace
Classes: Raw
Instance Method Summary collapse
- #excluded ⇒ Object
- #included ⇒ Object
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
- #weekdays ⇒ Object
Constructor Details
#initialize ⇒ Configuration
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
#excluded ⇒ Object
24 25 26 27 28 29 |
# File 'lib/clavius/configuration.rb', line 24 def excluded raw.excluded .select { |date| date.respond_to?(:to_date) } .map(&:to_date) .to_set end |
#included ⇒ Object
17 18 19 20 21 22 |
# File 'lib/clavius/configuration.rb', line 17 def included raw.included .select { |date| date.respond_to?(:to_date) } .map(&:to_date) .to_set end |
#weekdays ⇒ Object
10 11 12 13 14 15 |
# File 'lib/clavius/configuration.rb', line 10 def weekdays raw.weekdays .select(&Time::WEEKDAYS.method(:include?)) .map(&Time::WEEKDAYS.method(:index)) .to_set end |