Module: Pusher::PushNotifications
- Defined in:
- lib/pusher/push_notifications.rb,
lib/pusher/push_notifications/token.rb,
lib/pusher/push_notifications/client.rb,
lib/pusher/push_notifications/user_id.rb,
lib/pusher/push_notifications/version.rb,
lib/pusher/push_notifications/use_cases/publish.rb,
lib/pusher/push_notifications/use_cases/delete_user.rb,
lib/pusher/push_notifications/use_cases/generate_token.rb,
lib/pusher/push_notifications/use_cases/publish_to_users.rb
Defined Under Namespace
Modules: UseCases
Classes: Client, PushError, Token, UserId
Constant Summary
collapse
- VERSION =
'2.0.2'
Class Attribute Summary collapse
Class Method Summary
collapse
Class Attribute Details
.instance_id ⇒ Object
Returns the value of attribute instance_id.
17
18
19
|
# File 'lib/pusher/push_notifications.rb', line 17
def instance_id
@instance_id
end
|
.secret_key ⇒ Object
Returns the value of attribute secret_key.
17
18
19
|
# File 'lib/pusher/push_notifications.rb', line 17
def secret_key
@secret_key
end
|
Class Method Details
19
20
21
22
23
24
|
# File 'lib/pusher/push_notifications.rb', line 19
def configure
yield(self)
dup
end
|
.delete_user(user:) ⇒ Object
.endpoint ⇒ Object
44
45
46
47
48
|
# File 'lib/pusher/push_notifications.rb', line 44
def endpoint
return @endpoint unless @endpoint.nil?
"https://#{@instance_id}.pushnotifications.pusher.com"
end
|
.endpoint=(endpoint) ⇒ Object
38
39
40
41
42
|
# File 'lib/pusher/push_notifications.rb', line 38
def endpoint=(endpoint)
raise PushError, 'Invalid endpoint override' if !endpoint.nil? && endpoint.delete(' ').empty?
@endpoint = endpoint
end
|
.generate_token(user:) ⇒ Object
.publish(interests:, payload: {}) ⇒ Object
50
51
52
|
# File 'lib/pusher/push_notifications.rb', line 50
def publish(interests:, payload: {})
UseCases::Publish.publish(client, interests: interests, payload: payload)
end
|
.publish_to_interests(interests:, payload: {}) ⇒ Object
54
55
56
|
# File 'lib/pusher/push_notifications.rb', line 54
def publish_to_interests(interests:, payload: {})
UseCases::Publish.publish_to_interests(client, interests: interests, payload: payload)
end
|
.publish_to_users(users:, payload: {}) ⇒ Object