Module: Harmoniser::Configurable

Included in:
Harmoniser
Defined in:
lib/harmoniser/configurable.rb

Instance Method Summary collapse

Instance Method Details

#configurationObject

Raises:

  • (NoMethodError)


10
11
12
13
14
# File 'lib/harmoniser/configurable.rb', line 10

def configuration
  raise NoMethodError.new("Please, configure first") unless @configuration

  @configuration
end

#configure {|@configuration| ... } ⇒ Object

Yields:



5
6
7
8
# File 'lib/harmoniser/configurable.rb', line 5

def configure
  @configuration ||= Configuration.new
  yield(@configuration)
end

#default_configurationObject



16
17
18
# File 'lib/harmoniser/configurable.rb', line 16

def default_configuration
  @configuration ||= Configuration.new
end