Class: ProxyMachine::Config

Inherits:
Object show all
Defined in:
lib/proxy_machine/config.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfig

Returns a new instance of Config.



5
6
7
# File 'lib/proxy_machine/config.rb', line 5

def initialize
  @callbacks = {}
end

Instance Attribute Details

#callbacksObject (readonly)

Returns the value of attribute callbacks.



4
5
6
# File 'lib/proxy_machine/config.rb', line 4

def callbacks
  @callbacks
end

Instance Method Details

#after(hash) ⇒ Object



29
30
31
# File 'lib/proxy_machine/config.rb', line 29

def after hash
  @callbacks[:after] = hash
end

#after_all(params = nil, &block) ⇒ Object



33
34
35
# File 'lib/proxy_machine/config.rb', line 33

def after_all params = nil, &block
  @callbacks[:after_all] = params ? params : block
end

#allow_dinamic(boolean) ⇒ Object



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

def allow_dinamic boolean
  @callbacks[:allow_dinamic] = boolean
end

#apply!(&block) ⇒ Object



9
10
11
# File 'lib/proxy_machine/config.rb', line 9

def apply! &block
  instance_exec(&block)
end

#avoid_original_execution(boolean) ⇒ Object



17
18
19
# File 'lib/proxy_machine/config.rb', line 17

def avoid_original_execution boolean
  @callbacks[:avoid_original_execution] = boolean
end

#before(hash) ⇒ Object



21
22
23
# File 'lib/proxy_machine/config.rb', line 21

def before hash
  @callbacks[:before] = hash
end

#before_all(params = nil, &block) ⇒ Object



25
26
27
# File 'lib/proxy_machine/config.rb', line 25

def before_all params = nil, &block
  @callbacks[:before_all] = params ? params : block
end