Class: Celerity::IgnoringWebConnection

Inherits:
HtmlUnit::Util::FalsifyingWebConnection
  • Object
show all
Defined in:
lib/celerity/ignoring_web_connection.rb

Instance Method Summary collapse

Constructor Details

#initialize(web_client, pattern) ⇒ IgnoringWebConnection

Returns a new instance of IgnoringWebConnection


4
5
6
7
# File 'lib/celerity/ignoring_web_connection.rb', line 4

def initialize(web_client, pattern)
  super(web_client)
  @pattern = pattern
end

Instance Method Details

#getResponse(request_settings) ⇒ Object


9
10
11
12
# File 'lib/celerity/ignoring_web_connection.rb', line 9

def getResponse(request_settings)
  return super unless request_settings.getUrl.toString =~ @pattern
  createWebResponse(request_settings, "", "text/html")
end