Class: OneSignal::Client
- Inherits:
-
Object
- Object
- OneSignal::Client
- Defined in:
- lib/onesignal/client.rb
Constant Summary collapse
- BASE_URL =
'https://onesignal.com/api/v1'.freeze
Instance Attribute Summary collapse
-
#app_id ⇒ Object
readonly
Returns the value of attribute app_id.
-
#auth_token ⇒ Object
readonly
Returns the value of attribute auth_token.
Instance Method Summary collapse
- #apps ⇒ Object
-
#initialize(auth_token: nil, app_id: nil) ⇒ Client
constructor
A new instance of Client.
- #notifications ⇒ Object
- #players ⇒ Object
Constructor Details
#initialize(auth_token: nil, app_id: nil) ⇒ Client
Returns a new instance of Client.
7 8 9 10 11 12 |
# File 'lib/onesignal/client.rb', line 7 def initialize(auth_token: nil, app_id: nil) @auth_token = auth_token @app_id = app_id ensure_auth_token_presence end |
Instance Attribute Details
#app_id ⇒ Object (readonly)
Returns the value of attribute app_id.
5 6 7 |
# File 'lib/onesignal/client.rb', line 5 def app_id @app_id end |
#auth_token ⇒ Object (readonly)
Returns the value of attribute auth_token.
5 6 7 |
# File 'lib/onesignal/client.rb', line 5 def auth_token @auth_token end |
Instance Method Details
#apps ⇒ Object
14 15 16 |
# File 'lib/onesignal/client.rb', line 14 def apps @apps ||= AppResource.new(self) end |
#notifications ⇒ Object
24 25 26 27 28 |
# File 'lib/onesignal/client.rb', line 24 def notifications ensure_app_id_presence @notifications ||= NotificationResource.new(self) end |
#players ⇒ Object
18 19 20 21 22 |
# File 'lib/onesignal/client.rb', line 18 def players ensure_app_id_presence @players ||= PlayerResource.new(self) end |