Class: HeyYou::Config::Push
- Inherits:
-
Object
- Object
- HeyYou::Config::Push
- Extended by:
- Configurable
- Defined in:
- lib/hey_you/config/push.rb
Defined Under Namespace
Classes: FcmTokenNotExists
Constant Summary collapse
- DEFAULT_PRIORITY =
'high'- DEFAULT_TTL =
60- DEFAULT_FCM_TIMEOUT =
30
Instance Attribute Summary collapse
-
#fcm_timeout ⇒ Object
Returns the value of attribute fcm_timeout.
-
#fcm_token ⇒ Object
Returns the value of attribute fcm_token.
-
#priority ⇒ Object
Returns the value of attribute priority.
-
#ttl ⇒ Object
Returns the value of attribute ttl.
Instance Method Summary collapse
- #fcm_client ⇒ Object
-
#initialize ⇒ Push
constructor
A new instance of Push.
Methods included from Configurable
Constructor Details
#initialize ⇒ Push
Returns a new instance of Push.
15 16 17 18 19 |
# File 'lib/hey_you/config/push.rb', line 15 def initialize @priority = DEFAULT_PRIORITY @ttl = DEFAULT_TTL @fcm_timeout = DEFAULT_FCM_TIMEOUT end |
Instance Attribute Details
#fcm_timeout ⇒ Object
Returns the value of attribute fcm_timeout.
13 14 15 |
# File 'lib/hey_you/config/push.rb', line 13 def fcm_timeout @fcm_timeout end |
#fcm_token ⇒ Object
Returns the value of attribute fcm_token.
13 14 15 |
# File 'lib/hey_you/config/push.rb', line 13 def fcm_token @fcm_token end |
#priority ⇒ Object
Returns the value of attribute priority.
13 14 15 |
# File 'lib/hey_you/config/push.rb', line 13 def priority @priority end |
#ttl ⇒ Object
Returns the value of attribute ttl.
13 14 15 |
# File 'lib/hey_you/config/push.rb', line 13 def ttl @ttl end |
Instance Method Details
#fcm_client ⇒ Object
21 22 23 24 |
# File 'lib/hey_you/config/push.rb', line 21 def fcm_client raise FcmTokenNotExists, 'Can\'t create fcm client: fcm_token not exists' unless fcm_token @fcm_client ||= FCM.new(fcm_token, timeout: fcm_timeout) end |