Class: Enstratus::Request
- Inherits:
-
Object
- Object
- Enstratus::Request
- Defined in:
- lib/enstratus/request.rb
Instance Attribute Summary collapse
-
#connection ⇒ Object
readonly
Returns the value of attribute connection.
-
#namespace ⇒ Object
Returns the value of attribute namespace.
-
#query_params ⇒ Object
Returns the value of attribute query_params.
-
#resource ⇒ Object
Returns the value of attribute resource.
Instance Method Summary collapse
-
#initialize(req_path, query_params = {}) ⇒ Request
constructor
A new instance of Request.
Constructor Details
#initialize(req_path, query_params = {}) ⇒ Request
Returns a new instance of Request.
7 8 9 10 11 12 |
# File 'lib/enstratus/request.rb', line 7 def initialize(req_path, query_params={}) req_path ||= 'geography/Cloud/1' @resource = "/api/enstratus/#{Enstratus.configuration.version}/#{req_path}" @connection = Excon.new(Enstratus.configuration.endpoint) @query_params = query_params end |
Instance Attribute Details
#connection ⇒ Object (readonly)
Returns the value of attribute connection.
5 6 7 |
# File 'lib/enstratus/request.rb', line 5 def connection @connection end |
#namespace ⇒ Object
Returns the value of attribute namespace.
4 5 6 |
# File 'lib/enstratus/request.rb', line 4 def namespace @namespace end |
#query_params ⇒ Object
Returns the value of attribute query_params.
4 5 6 |
# File 'lib/enstratus/request.rb', line 4 def query_params @query_params end |
#resource ⇒ Object
Returns the value of attribute resource.
4 5 6 |
# File 'lib/enstratus/request.rb', line 4 def resource @resource end |