Module: Cottontail::Configurable::ClassMethods

Defined in:
lib/cottontail/configurable.rb

Overview

:nodoc:

Instance Method Summary collapse

Instance Method Details

#configObject



11
12
13
14
15
16
17
18
19
20
21
# File 'lib/cottontail/configurable.rb', line 11

def config
  return @__config__ if defined?(@__config__)

  @__config__ =
    if respond_to?(:superclass) && superclass.respond_to?(:config)
      superclass.config.inheritable_copy
    else
      # create a new "anonymous" class
      Class.new(Configuration).new
    end
end

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

Yields:



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

def configure
  yield config
end