Class: Terminal::Request
- Inherits:
-
Object
- Object
- Terminal::Request
- Defined in:
- lib/terminal/request.rb
Instance Attribute Summary collapse
-
#client ⇒ Object
Returns the value of attribute client.
-
#options ⇒ Object
Returns the value of attribute options.
-
#path ⇒ Object
Returns the value of attribute path.
-
#request_method ⇒ Object
Returns the value of attribute request_method.
Instance Method Summary collapse
-
#initialize(client, request_method, path, options = {}) ⇒ Request
constructor
A new instance of Request.
- #perform ⇒ Object
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, = {}) @client = client @request_method = request_method @path = path @options = end |
Instance Attribute Details
#client ⇒ Object
Returns the value of attribute client.
3 4 5 |
# File 'lib/terminal/request.rb', line 3 def client @client end |
#options ⇒ Object
Returns the value of attribute options.
3 4 5 |
# File 'lib/terminal/request.rb', line 3 def @options end |
#path ⇒ Object
Returns the value of attribute path.
3 4 5 |
# File 'lib/terminal/request.rb', line 3 def path @path end |
#request_method ⇒ Object
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
#perform ⇒ Object
12 13 14 |
# File 'lib/terminal/request.rb', line 12 def perform @client.send(@request_method, @path, @options).body end |