Module: Amoeba::ClassMethods

Defined in:
lib/amoeba/class_methods.rb

Instance Method Summary collapse

Instance Method Details

#amoeba(&block) ⇒ Object



3
4
5
6
7
8
9
# File 'lib/amoeba/class_methods.rb', line 3

def amoeba(&block)
  @config_block ||= block if block_given?

  @config ||= Amoeba::Config.new(self)
  @config.instance_eval(&block) if block_given?
  @config
end

#amoeba_blockObject



19
20
21
# File 'lib/amoeba/class_methods.rb', line 19

def amoeba_block
  @config_block
end

#fresh_amoeba(&block) ⇒ Object



11
12
13
14
15
16
17
# File 'lib/amoeba/class_methods.rb', line 11

def fresh_amoeba(&block)
  @config_block = block if block_given?

  @config = Amoeba::Config.new(self)
  @config.instance_eval(&block) if block_given?
  @config
end