Class: DdrAux::Client::Request

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

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(path) ⇒ Request

Returns a new instance of Request.



10
11
12
13
# File 'lib/ddr_aux/client/request.rb', line 10

def initialize(path)
  @path = path
  @connection = Connection.new
end

Instance Attribute Details

#connectionObject (readonly)

Returns the value of attribute connection.



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

def connection
  @connection
end

#pathObject (readonly)

Returns the value of attribute path.



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

def path
  @path
end

Class Method Details

.get_response(path) ⇒ Object



6
7
8
# File 'lib/ddr_aux/client/request.rb', line 6

def self.get_response(path)
  new(path).get_response
end

Instance Method Details

#get_responseObject



15
16
17
18
19
# File 'lib/ddr_aux/client/request.rb', line 15

def get_response
  request_path = DdrAux::Client.uri.path + path
  http_res = connection.get(request_path, request_headers)
  Response.new http_res
end