Class: HeyYouFcmPush::MessageObject::ApnsConfig
- Inherits:
-
Object
- Object
- HeyYouFcmPush::MessageObject::ApnsConfig
- Defined in:
- lib/hey_you_fcm_push/message_object/apns_config.rb
Instance Attribute Summary collapse
-
#to_h ⇒ Object
readonly
Returns the value of attribute to_h.
Instance Method Summary collapse
-
#initialize(headers: nil, payload: nil, fcm_options: nil) ⇒ ApnsConfig
constructor
A new instance of ApnsConfig.
Constructor Details
#initialize(headers: nil, payload: nil, fcm_options: nil) ⇒ ApnsConfig
Returns a new instance of ApnsConfig.
6 7 8 9 10 11 12 13 14 15 16 17 18 |
# File 'lib/hey_you_fcm_push/message_object/apns_config.rb', line 6 def initialize(headers: nil, payload: nil, fcm_options: nil) = &.transform_keys(&:to_sym) hash = { headers: headers, payload: payload } if hash.merge!( fcm_options: FcmOptions.new(analytics_label: [:analytics_label], image: [:image]).to_h ) end @to_h = hash end |
Instance Attribute Details
#to_h ⇒ Object (readonly)
Returns the value of attribute to_h.
4 5 6 |
# File 'lib/hey_you_fcm_push/message_object/apns_config.rb', line 4 def to_h @to_h end |