Module: ConfigNewton::ClassMethods

Defined in:
lib/config_newton.rb

Instance Method Summary collapse

Instance Method Details

#config(*args) ⇒ Object

Retrieve the configuration object or pass arguments identical to #configurable to add a new configuration property.



30
31
32
# File 'lib/config_newton.rb', line 30

def config(*args)
  args.any?? self.configurable(*args) : configuration
end

#configurablesObject

A list of configurable properties.



18
19
20
# File 'lib/config_newton.rb', line 18

def configurables
  configuration.properties
end

#configurationObject

The configuration object.



23
24
25
# File 'lib/config_newton.rb', line 23

def configuration
  @configuration
end

#configure(options = {}, &block) ⇒ Object

Configure the class either with a hash or by providing a block. See the documentation for Configuration#set.



13
14
15
# File 'lib/config_newton.rb', line 13

def configure(options = {}, &block)
  config.set(options, &block)
end