Class: Enstratus::Request

Inherits:
Object
  • Object
show all
Defined in:
lib/enstratus/request.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#connectionObject (readonly)

Returns the value of attribute connection.



5
6
7
# File 'lib/enstratus/request.rb', line 5

def connection
  @connection
end

#namespaceObject

Returns the value of attribute namespace.



4
5
6
# File 'lib/enstratus/request.rb', line 4

def namespace
  @namespace
end

#query_paramsObject

Returns the value of attribute query_params.



4
5
6
# File 'lib/enstratus/request.rb', line 4

def query_params
  @query_params
end

#resourceObject

Returns the value of attribute resource.



4
5
6
# File 'lib/enstratus/request.rb', line 4

def resource
  @resource
end