Class: BellyWash::Configuration
- Inherits:
-
Object
- Object
- BellyWash::Configuration
- Defined in:
- lib/belly_wash/configuration.rb
Instance Attribute Summary collapse
-
#beginning_of_week ⇒ Object
Returns the value of attribute beginning_of_week.
-
#driver ⇒ Object
Returns the value of attribute driver.
-
#separator ⇒ Object
Returns the value of attribute separator.
-
#time_zone ⇒ Object
Returns the value of attribute time_zone.
-
#track_ranges ⇒ Object
Returns the value of attribute track_ranges.
Instance Method Summary collapse
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
- #ranges ⇒ Object
- #tz ⇒ Object
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
10 11 12 13 14 |
# File 'lib/belly_wash/configuration.rb', line 10 def initialize @separator = '::' @ranges = %i[minute hour day week month quarter year] @beginning_of_week = :monday end |
Instance Attribute Details
#beginning_of_week ⇒ Object
Returns the value of attribute beginning_of_week.
7 8 9 |
# File 'lib/belly_wash/configuration.rb', line 7 def beginning_of_week @beginning_of_week end |
#driver ⇒ Object
Returns the value of attribute driver.
7 8 9 |
# File 'lib/belly_wash/configuration.rb', line 7 def driver @driver end |
#separator ⇒ Object
Returns the value of attribute separator.
7 8 9 |
# File 'lib/belly_wash/configuration.rb', line 7 def separator @separator end |
#time_zone ⇒ Object
Returns the value of attribute time_zone.
7 8 9 |
# File 'lib/belly_wash/configuration.rb', line 7 def time_zone @time_zone end |
#track_ranges ⇒ Object
Returns the value of attribute track_ranges.
7 8 9 |
# File 'lib/belly_wash/configuration.rb', line 7 def track_ranges @track_ranges end |
Instance Method Details
#ranges ⇒ Object
24 25 26 27 28 |
# File 'lib/belly_wash/configuration.rb', line 24 def ranges return @ranges if blank?(track_ranges) @ranges & track_ranges end |
#tz ⇒ Object
16 17 18 19 20 21 22 |
# File 'lib/belly_wash/configuration.rb', line 16 def tz TZInfo::Timezone.get(@time_zone) rescue TZInfo::InvalidTimezoneIdentifier => e puts "BellyWash: #{e} - #{time_zone_name}; Defaulting to GMT." TZInfo::Timezone.get('GMT') end |