Class: Safettp::Request
- Inherits:
-
Object
- Object
- Safettp::Request
- Defined in:
- lib/safettp/request.rb
Defined Under Namespace
Classes: Net
Instance Attribute Summary collapse
-
#options ⇒ Object
readonly
Returns the value of attribute options.
-
#uri ⇒ Object
readonly
Returns the value of attribute uri.
Instance Method Summary collapse
-
#initialize(uri, options = {}) ⇒ Request
constructor
A new instance of Request.
- #perform(method) ⇒ Object
Constructor Details
#initialize(uri, options = {}) ⇒ Request
Returns a new instance of Request.
4 5 6 7 8 |
# File 'lib/safettp/request.rb', line 4 def initialize(uri, = {}) @uri = URI(uri) = Safettp::HTTPOptions.new() @uri.query = .query end |
Instance Attribute Details
#options ⇒ Object (readonly)
Returns the value of attribute options.
2 3 4 |
# File 'lib/safettp/request.rb', line 2 def end |
#uri ⇒ Object (readonly)
Returns the value of attribute uri.
2 3 4 |
# File 'lib/safettp/request.rb', line 2 def uri @uri end |
Instance Method Details
#perform(method) ⇒ Object
10 11 12 13 |
# File 'lib/safettp/request.rb', line 10 def perform(method) net = Safettp::Request::Net.new(method, uri, ) Safettp::Response.new(net.perform, .parser) end |