Class: Pushwoosh::Request
- Inherits:
-
Object
- Object
- Pushwoosh::Request
- Includes:
- HTTParty
- Defined in:
- lib/pushwoosh/request.rb
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(url, options = {}) ⇒ Request
constructor
A new instance of Request.
- #make_post! ⇒ Object
Constructor Details
#initialize(url, options = {}) ⇒ Request
Returns a new instance of Request.
14 15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/pushwoosh/request.rb', line 14 def initialize(url, = {}) validations!(url, ) @options = @notification_options = .fetch(:notification_options) @url = url @base_request = { request: { application: [:application], auth: [:auth] } } end |
Class Method Details
.make_post!(*args) ⇒ Object
10 11 12 |
# File 'lib/pushwoosh/request.rb', line 10 def self.make_post!(*args) new(*args).make_post! end |
Instance Method Details
#make_post! ⇒ Object
28 29 30 31 |
# File 'lib/pushwoosh/request.rb', line 28 def make_post! response = self.class.post(url, body: build_request.to_json).parsed_response Response.new(response) end |