Class: Voorhees::Request
- Inherits:
-
Object
- Object
- Voorhees::Request
- Defined in:
- lib/voorhees/request.rb
Instance Attribute Summary collapse
-
#base_uri ⇒ Object
Returns the value of attribute base_uri.
-
#defaults ⇒ Object
Returns the value of attribute defaults.
-
#hierarchy ⇒ Object
Returns the value of attribute hierarchy.
-
#http_method ⇒ Object
Returns the value of attribute http_method.
-
#parameters ⇒ Object
Returns the value of attribute parameters.
-
#path ⇒ Object
Returns the value of attribute path.
-
#required ⇒ Object
Returns the value of attribute required.
-
#retries ⇒ Object
Returns the value of attribute retries.
-
#timeout ⇒ Object
Returns the value of attribute timeout.
Instance Method Summary collapse
-
#initialize(caller_class = nil) ⇒ Request
constructor
A new instance of Request.
- #perform ⇒ Object
- #uri ⇒ Object
Constructor Details
#initialize(caller_class = nil) ⇒ Request
Returns a new instance of Request.
12 13 14 |
# File 'lib/voorhees/request.rb', line 12 def initialize(caller_class=nil) @caller_class = caller_class end |
Instance Attribute Details
#base_uri ⇒ Object
Returns the value of attribute base_uri.
8 9 10 |
# File 'lib/voorhees/request.rb', line 8 def base_uri @base_uri end |
#defaults ⇒ Object
Returns the value of attribute defaults.
8 9 10 |
# File 'lib/voorhees/request.rb', line 8 def defaults @defaults end |
#hierarchy ⇒ Object
Returns the value of attribute hierarchy.
8 9 10 |
# File 'lib/voorhees/request.rb', line 8 def hierarchy @hierarchy end |
#http_method ⇒ Object
Returns the value of attribute http_method.
8 9 10 |
# File 'lib/voorhees/request.rb', line 8 def http_method @http_method end |
#parameters ⇒ Object
Returns the value of attribute parameters.
8 9 10 |
# File 'lib/voorhees/request.rb', line 8 def parameters @parameters end |
#path ⇒ Object
Returns the value of attribute path.
8 9 10 |
# File 'lib/voorhees/request.rb', line 8 def path @path end |
#required ⇒ Object
Returns the value of attribute required.
8 9 10 |
# File 'lib/voorhees/request.rb', line 8 def required @required end |
#retries ⇒ Object
Returns the value of attribute retries.
8 9 10 |
# File 'lib/voorhees/request.rb', line 8 def retries @retries end |
#timeout ⇒ Object
Returns the value of attribute timeout.
8 9 10 |
# File 'lib/voorhees/request.rb', line 8 def timeout @timeout end |
Instance Method Details
#perform ⇒ Object
48 49 50 51 |
# File 'lib/voorhees/request.rb', line 48 def perform setup_request parse_response(perform_actual_request) end |
#uri ⇒ Object
20 21 22 23 24 25 26 |
# File 'lib/voorhees/request.rb', line 20 def uri u = path.relative? ? URI.parse("#{base_uri}#{path}") : path if query = query_string(u) u.query = query end u end |