Class: Fortenet::Request
- Inherits:
-
Object
- Object
- Fortenet::Request
- Includes:
- HTTParty
- Defined in:
- lib/fortenet/request.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#response ⇒ Object
readonly
Returns the value of attribute response.
Instance Method Summary collapse
- #delete(path, **options) ⇒ Object
- #get(path, **options) ⇒ Object
- #parsed_response ⇒ Object
- #post(path, **options) ⇒ Object
- #put(path, **options) ⇒ Object
Instance Attribute Details
#response ⇒ Object
Returns the value of attribute response.
8 9 10 |
# File 'lib/fortenet/request.rb', line 8 def response @response end |
Instance Method Details
#delete(path, **options) ⇒ Object
22 23 24 |
# File 'lib/fortenet/request.rb', line 22 def delete(path, **) self.response = self.class.delete(Fortenet.endpoint + path, set_auth()) end |
#get(path, **options) ⇒ Object
10 11 12 |
# File 'lib/fortenet/request.rb', line 10 def get(path, **) self.response = self.class.get(Fortenet.endpoint + path, set_auth()) end |
#parsed_response ⇒ Object
26 27 28 29 30 |
# File 'lib/fortenet/request.rb', line 26 def parsed_response return if response.nil? JSON.parse response.body, symbolize_names: true end |
#post(path, **options) ⇒ Object
14 15 16 |
# File 'lib/fortenet/request.rb', line 14 def post(path, **) self.response = self.class.post(Fortenet.endpoint + path, set_auth()) end |
#put(path, **options) ⇒ Object
18 19 20 |
# File 'lib/fortenet/request.rb', line 18 def put(path, **) self.response = self.class.put(Fortenet.endpoint + path, set_auth()) end |