Class: Maia::FCM::Notification

Inherits:
Object
  • Object
show all
Defined in:
lib/maia/fcm/notification.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ Notification

Returns a new instance of Notification.



6
7
8
# File 'lib/maia/fcm/notification.rb', line 6

def initialize(attributes = {})
  @attributes = attributes
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(method_name, *args, &block) ⇒ Object



18
19
20
# File 'lib/maia/fcm/notification.rb', line 18

def method_missing(method_name, *args, &block)
  @attributes.fetch(method_name) { super }
end

Instance Attribute Details

#attributesObject

Returns the value of attribute attributes.



4
5
6
# File 'lib/maia/fcm/notification.rb', line 4

def attributes
  @attributes
end

Instance Method Details

#==(other) ⇒ Object



14
15
16
# File 'lib/maia/fcm/notification.rb', line 14

def ==(other)
  attributes == other.attributes
end

#respond_to_missing?(method_name) ⇒ Boolean

Returns:

  • (Boolean)


22
23
24
# File 'lib/maia/fcm/notification.rb', line 22

def respond_to_missing?(method_name)
  @attributes.include? method_name
end

#to_hObject



10
11
12
# File 'lib/maia/fcm/notification.rb', line 10

def to_h
  @attributes
end