Class: Fortenet::Request

Inherits:
Object
  • Object
show all
Includes:
HTTParty
Defined in:
lib/fortenet/request.rb

Direct Known Subclasses

Client

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#responseObject

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, **options)
  self.response = self.class.delete(Fortenet.endpoint + path, set_auth(options))
end

#get(path, **options) ⇒ Object



10
11
12
# File 'lib/fortenet/request.rb', line 10

def get(path, **options)
  self.response = self.class.get(Fortenet.endpoint + path, set_auth(options))
end

#parsed_responseObject



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, **options)
  self.response = self.class.post(Fortenet.endpoint + path, set_auth(options))
end

#put(path, **options) ⇒ Object



18
19
20
# File 'lib/fortenet/request.rb', line 18

def put(path, **options)
  self.response = self.class.put(Fortenet.endpoint + path, set_auth(options))
end