Class: Hoodie::Configuration

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

Overview

A Configuration instance

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) {|_self| ... } ⇒ undefined

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Initialized a configuration instance

Yields:

  • (_self)

Yield Parameters:



19
20
21
22
23
24
# File 'lib/hoodie/configuration.rb', line 19

def initialize(options={})
  @logging = options.fetch(:logging, false)
  @level   = options.fetch(:level,   :info)

  yield self if block_given?
end

Instance Attribute Details

#levelObject

Access to the logging level for this instance



12
13
14
# File 'lib/hoodie/configuration.rb', line 12

def level
  @level
end

#loggingObject

Access the logging setting for this instance



9
10
11
# File 'lib/hoodie/configuration.rb', line 9

def logging
  @logging
end

Instance Method Details

#to_hObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



27
28
29
30
31
# File 'lib/hoodie/configuration.rb', line 27

def to_h
  { logging: logging,
    level:   level
  }.freeze
end