Module: ConfigurableFromEnv::Configurable::ClassMethods

Defined in:
lib/configurable_from_env/configurable.rb

Instance Method Summary collapse

Instance Method Details

#configObject



52
53
54
55
56
57
58
59
# File 'lib/configurable_from_env/configurable.rb', line 52

def config
  @_config ||= if respond_to?(:superclass) && superclass.respond_to?(:config)
    superclass.config.inheritable_copy
  else
    # create a new "anonymous" class that will host the compiled reader methods
    Class.new(Configuration).new
  end
end

#configure {|config| ... } ⇒ Object

Yields:



61
62
63
# File 'lib/configurable_from_env/configurable.rb', line 61

def configure
  yield config
end