Class: Terminal::Request

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(client, request_method, path, options = {}) ⇒ Request

Returns a new instance of Request.



5
6
7
8
9
10
# File 'lib/terminal/request.rb', line 5

def initialize(client, request_method, path, options = {})
  @client = client
  @request_method = request_method
  @path = path
  @options = options
end

Instance Attribute Details

#clientObject

Returns the value of attribute client.



3
4
5
# File 'lib/terminal/request.rb', line 3

def client
  @client
end

#optionsObject

Returns the value of attribute options.



3
4
5
# File 'lib/terminal/request.rb', line 3

def options
  @options
end

#pathObject

Returns the value of attribute path.



3
4
5
# File 'lib/terminal/request.rb', line 3

def path
  @path
end

#request_methodObject

Returns the value of attribute request_method.



3
4
5
# File 'lib/terminal/request.rb', line 3

def request_method
  @request_method
end

Instance Method Details

#performObject



12
13
14
# File 'lib/terminal/request.rb', line 12

def perform
  @client.send(@request_method, @path, @options).body
end