Class: Auger::Request
- Inherits:
-
Object
- Object
- Auger::Request
- Defined in:
- lib/auger/request.rb
Direct Known Subclasses
CqlRequest, DnsDomainRequest, DnsQueryRequest, HttpRequest, RedisDbsize, RedisExists, RedisGet, RedisInfo, RedisPing, SocketRequest, TelnetRequest
Instance Attribute Summary collapse
-
#arg ⇒ Object
Returns the value of attribute arg.
-
#before_tests_proc ⇒ Object
Returns the value of attribute before_tests_proc.
-
#response ⇒ Object
Returns the value of attribute response.
-
#tests ⇒ Object
Returns the value of attribute tests.
Class Method Summary collapse
Instance Method Summary collapse
-
#before_tests(&block) ⇒ Object
callback to be run after request, but before tests.
-
#do_run(conn) ⇒ Object
call plugin run() and return plugin-specfic response object or exception.
-
#initialize(arg) ⇒ Request
constructor
A new instance of Request.
- #test(name, &block) ⇒ Object
Constructor Details
#initialize(arg) ⇒ Request
Returns a new instance of Request.
12 13 14 15 |
# File 'lib/auger/request.rb', line 12 def initialize(arg) @arg = arg @tests = [] end |
Instance Attribute Details
#arg ⇒ Object
Returns the value of attribute arg.
4 5 6 |
# File 'lib/auger/request.rb', line 4 def arg @arg end |
#before_tests_proc ⇒ Object
Returns the value of attribute before_tests_proc.
4 5 6 |
# File 'lib/auger/request.rb', line 4 def before_tests_proc @before_tests_proc end |
#response ⇒ Object
Returns the value of attribute response.
4 5 6 |
# File 'lib/auger/request.rb', line 4 def response @response end |
#tests ⇒ Object
Returns the value of attribute tests.
4 5 6 |
# File 'lib/auger/request.rb', line 4 def tests @tests end |
Class Method Details
.load(arg, &block) ⇒ Object
6 7 8 9 10 |
# File 'lib/auger/request.rb', line 6 def self.load(arg, &block) request = new(arg) request.instance_eval(&block) request end |
Instance Method Details
#before_tests(&block) ⇒ Object
callback to be run after request, but before tests
22 23 24 |
# File 'lib/auger/request.rb', line 22 def before_tests(&block) @before_tests_proc = block end |
#do_run(conn) ⇒ Object
call plugin run() and return plugin-specfic response object or exception
27 28 29 30 31 32 33 34 35 36 |
# File 'lib/auger/request.rb', line 27 def do_run(conn) return conn if conn.is_a? Exception begin response = self.run(conn) response = self.before_tests_proc.call(response) if self.before_tests_proc response rescue => e e end end |