Class: Eventflit::NativeNotification::Client
- Inherits:
-
Object
- Object
- Eventflit::NativeNotification::Client
- Defined in:
- lib/eventflit/native_notification/client.rb
Constant Summary collapse
- API_PREFIX =
"publisher/app/"
Instance Attribute Summary collapse
-
#app_id ⇒ Object
readonly
Returns the value of attribute app_id.
-
#host ⇒ Object
readonly
Returns the value of attribute host.
Instance Method Summary collapse
-
#initialize(app_id, host, scheme, eventflit_client) ⇒ Client
constructor
A new instance of Client.
-
#notify(interests, data = {}) ⇒ Object
Send a notification via the native notifications API.
Constructor Details
#initialize(app_id, host, scheme, eventflit_client) ⇒ Client
Returns a new instance of Client.
8 9 10 11 12 13 |
# File 'lib/eventflit/native_notification/client.rb', line 8 def initialize(app_id, host, scheme, eventflit_client) @app_id = app_id @host = host @scheme = scheme @eventflit_client = eventflit_client end |
Instance Attribute Details
#app_id ⇒ Object (readonly)
Returns the value of attribute app_id.
4 5 6 |
# File 'lib/eventflit/native_notification/client.rb', line 4 def app_id @app_id end |
#host ⇒ Object (readonly)
Returns the value of attribute host.
4 5 6 |
# File 'lib/eventflit/native_notification/client.rb', line 4 def host @host end |
Instance Method Details
#notify(interests, data = {}) ⇒ Object
Send a notification via the native notifications API
16 17 18 19 20 21 22 23 24 |
# File 'lib/eventflit/native_notification/client.rb', line 16 def notify(interests, data = {}) Request.new( @eventflit_client, :post, url("/publishes"), {}, payload(interests, data) ).send_sync end |