Module: HttpStub::Configurator::Part

Defined in:
lib/http_stub/configurator/part.rb

Instance Method Summary collapse

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(name, *args, &block) ⇒ Object



12
13
14
# File 'lib/http_stub/configurator/part.rb', line 12

def method_missing(name, *args, &block)
  @configurator.respond_to?(name, true) ? @configurator.send(name, *args, &block) : super
end

Instance Method Details

#apply_to(configurator) ⇒ Object



6
7
8
9
10
# File 'lib/http_stub/configurator/part.rb', line 6

def apply_to(configurator)
  @configurator = configurator
  configuration_methods = self.methods.find_all { |method| method.to_s =~ /^configure_.+_(stub|scenario)s?$/ }
  configuration_methods.each { |configuration_method| self.send(configuration_method) }
end

#respond_to_missing?(name, include_private = false) ⇒ Boolean

Returns:

  • (Boolean)


16
17
18
# File 'lib/http_stub/configurator/part.rb', line 16

def respond_to_missing?(name, include_private = false)
  @configurator.respond_to?(name, include_private)
end