Module: HttpStub::Configurer::Part

Defined in:
lib/http_stub/configurer/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/configurer/part.rb', line 12

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

Instance Method Details

#configure(configurer) ⇒ Object



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

def configure(configurer)
  @configurer = configurer
  configure_methods = self.methods.find_all { |method| method.to_s =~ /^configure_.+_(stub|scenario)s?$/ }
  configure_methods.each { |configure_method| self.send(configure_method) }
end

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

Returns:

  • (Boolean)


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

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