Class: Typhoeus::HydraMock
- Inherits:
-
Object
- Object
- Typhoeus::HydraMock
- Defined in:
- lib/typhoeus/hydra.rb
Instance Attribute Summary collapse
-
#method ⇒ Object
readonly
Returns the value of attribute method.
-
#requests ⇒ Object
readonly
Returns the value of attribute requests.
-
#response ⇒ Object
readonly
Returns the value of attribute response.
-
#url ⇒ Object
readonly
Returns the value of attribute url.
Instance Method Summary collapse
- #add_request(request) ⇒ Object
- #and_return(val) ⇒ Object
-
#initialize(url, method) ⇒ HydraMock
constructor
A new instance of HydraMock.
Constructor Details
#initialize(url, method) ⇒ HydraMock
Returns a new instance of HydraMock.
146 147 148 149 150 |
# File 'lib/typhoeus/hydra.rb', line 146 def initialize(url, method) @url = url @method = method @requests = [] end |
Instance Attribute Details
#method ⇒ Object (readonly)
Returns the value of attribute method.
144 145 146 |
# File 'lib/typhoeus/hydra.rb', line 144 def method @method end |
#requests ⇒ Object (readonly)
Returns the value of attribute requests.
144 145 146 |
# File 'lib/typhoeus/hydra.rb', line 144 def requests @requests end |
#response ⇒ Object (readonly)
Returns the value of attribute response.
144 145 146 |
# File 'lib/typhoeus/hydra.rb', line 144 def response @response end |
#url ⇒ Object (readonly)
Returns the value of attribute url.
144 145 146 |
# File 'lib/typhoeus/hydra.rb', line 144 def url @url end |
Instance Method Details
#add_request(request) ⇒ Object
152 153 154 |
# File 'lib/typhoeus/hydra.rb', line 152 def add_request(request) @requests << request end |
#and_return(val) ⇒ Object
156 157 158 |
# File 'lib/typhoeus/hydra.rb', line 156 def and_return(val) @response = val end |