Class: Cassia::Requests::CloseNotify
- Inherits:
-
Object
- Object
- Cassia::Requests::CloseNotify
- Defined in:
- lib/cassia/requests/close_notify.rb
Instance Method Summary collapse
- #body ⇒ Object
- #headers ⇒ Object
-
#initialize(access_controller, aps:) ⇒ CloseNotify
constructor
A new instance of CloseNotify.
- #path ⇒ Object
- #perform ⇒ Object
Constructor Details
#initialize(access_controller, aps:) ⇒ CloseNotify
Returns a new instance of CloseNotify.
4 5 6 7 |
# File 'lib/cassia/requests/close_notify.rb', line 4 def initialize(access_controller, aps: ) @access_controller = access_controller @aps = aps end |
Instance Method Details
#body ⇒ Object
13 14 15 16 17 |
# File 'lib/cassia/requests/close_notify.rb', line 13 def body { 'aps' => @aps }.to_json end |
#headers ⇒ Object
19 20 21 22 23 24 |
# File 'lib/cassia/requests/close_notify.rb', line 19 def headers { 'Authorization' => "Bearer #{@access_controller.get_token}", 'Content-Type' => "application/json" } end |
#path ⇒ Object
9 10 11 |
# File 'lib/cassia/requests/close_notify.rb', line 9 def path '/api/aps/notify/close' end |
#perform ⇒ Object
26 27 28 |
# File 'lib/cassia/requests/close_notify.rb', line 26 def perform Cassia::ResponseHandlers::CloseNotify.new(@access_controller, aps: @aps).handle(Cassia.api.post(self)) end |