Class: Agilibox::FCM::Notifier
- Inherits:
-
Service
- Object
- Service
- Agilibox::FCM::Notifier
- Defined in:
- app/libs/agilibox/fcm/notifier.rb
Instance Attribute Summary collapse
-
#badge ⇒ Object
readonly
Returns the value of attribute badge.
-
#body ⇒ Object
readonly
Returns the value of attribute body.
-
#data ⇒ Object
readonly
Returns the value of attribute data.
-
#sound ⇒ Object
readonly
Returns the value of attribute sound.
-
#title ⇒ Object
readonly
Returns the value of attribute title.
-
#to ⇒ Object
readonly
Returns the value of attribute to.
Instance Method Summary collapse
-
#call ⇒ Object
rubocop:enable Metrics/ParameterLists.
-
#initialize(to:, title: nil, body:, badge: 0, sound: "default", data: {}) ⇒ Notifier
constructor
rubocop:disable Metrics/ParameterLists.
Constructor Details
#initialize(to:, title: nil, body:, badge: 0, sound: "default", data: {}) ⇒ Notifier
rubocop:disable Metrics/ParameterLists
5 6 7 8 9 10 11 12 13 |
# File 'app/libs/agilibox/fcm/notifier.rb', line 5 def initialize(to:, title: nil, body:, badge: 0, sound: "default", data: {}) super() @to = to @title = title @body = body @badge = badge @sound = sound @data = data end |
Instance Attribute Details
#badge ⇒ Object (readonly)
Returns the value of attribute badge.
2 3 4 |
# File 'app/libs/agilibox/fcm/notifier.rb', line 2 def badge @badge end |
#body ⇒ Object (readonly)
Returns the value of attribute body.
2 3 4 |
# File 'app/libs/agilibox/fcm/notifier.rb', line 2 def body @body end |
#data ⇒ Object (readonly)
Returns the value of attribute data.
2 3 4 |
# File 'app/libs/agilibox/fcm/notifier.rb', line 2 def data @data end |
#sound ⇒ Object (readonly)
Returns the value of attribute sound.
2 3 4 |
# File 'app/libs/agilibox/fcm/notifier.rb', line 2 def sound @sound end |
#title ⇒ Object (readonly)
Returns the value of attribute title.
2 3 4 |
# File 'app/libs/agilibox/fcm/notifier.rb', line 2 def title @title end |
#to ⇒ Object (readonly)
Returns the value of attribute to.
2 3 4 |
# File 'app/libs/agilibox/fcm/notifier.rb', line 2 def to @to end |
Instance Method Details
#call ⇒ Object
rubocop:enable Metrics/ParameterLists
16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'app/libs/agilibox/fcm/notifier.rb', line 16 def call Agilibox::FCM::Request.call( :to => to, :notification => { :title => title, :body => body, :badge => badge, :sound => sound, }, :data => data, ) end |