Class: Duracloud::Request
- Inherits:
-
Object
- Object
- Duracloud::Request
- Defined in:
- lib/duracloud/request.rb
Instance Attribute Summary collapse
-
#body ⇒ Object
readonly
Returns the value of attribute body.
-
#headers ⇒ Object
readonly
Returns the value of attribute headers.
-
#http_method ⇒ Object
readonly
Returns the value of attribute http_method.
-
#query ⇒ Object
readonly
Returns the value of attribute query.
-
#url ⇒ Object
readonly
Returns the value of attribute url.
Class Method Summary collapse
Instance Method Summary collapse
- #execute(&block) ⇒ Object
-
#initialize(http_method, url, **options) ⇒ Request
constructor
def initialize(client, http_method, url, body: nil, headers: nil, query: nil).
Constructor Details
#initialize(http_method, url, **options) ⇒ Request
def initialize(client, http_method, url, body: nil, headers: nil, query: nil)
20 21 22 23 24 |
# File 'lib/duracloud/request.rb', line 20 def initialize(http_method, url, **) @http_method = http_method @url = Addressable::URI.parse(url).normalize.to_s (.dup) end |
Instance Attribute Details
#body ⇒ Object (readonly)
Returns the value of attribute body.
7 8 9 |
# File 'lib/duracloud/request.rb', line 7 def body @body end |
#headers ⇒ Object (readonly)
Returns the value of attribute headers.
7 8 9 |
# File 'lib/duracloud/request.rb', line 7 def headers @headers end |
#http_method ⇒ Object (readonly)
Returns the value of attribute http_method.
7 8 9 |
# File 'lib/duracloud/request.rb', line 7 def http_method @http_method end |
#query ⇒ Object (readonly)
Returns the value of attribute query.
7 8 9 |
# File 'lib/duracloud/request.rb', line 7 def query @query end |
#url ⇒ Object (readonly)
Returns the value of attribute url.
7 8 9 |
# File 'lib/duracloud/request.rb', line 7 def url @url end |
Class Method Details
.execute(http_method, url, **options, &block) ⇒ Object
9 10 11 12 |
# File 'lib/duracloud/request.rb', line 9 def self.execute(http_method, url, **, &block) request = new(http_method, url, **) request.execute(&block) end |