Class: GCM::Notification
- Inherits:
-
Object
- Object
- GCM::Notification
- Includes:
- ActiveModel::Model
- Defined in:
- lib/mercurius/gcm/notification.rb
Instance Attribute Summary collapse
-
#attributes ⇒ Object
Returns the value of attribute attributes.
Instance Method Summary collapse
- #==(that) ⇒ Object
-
#initialize(attributes = {}) ⇒ Notification
constructor
A new instance of Notification.
- #method_missing(method, *args, &block) ⇒ Object
- #to_h ⇒ Object
Constructor Details
#initialize(attributes = {}) ⇒ Notification
Returns a new instance of Notification.
6 7 8 |
# File 'lib/mercurius/gcm/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, *args, &block) ⇒ Object
18 19 20 |
# File 'lib/mercurius/gcm/notification.rb', line 18 def method_missing(method, *args, &block) @attributes.fetch(method) { super } end |
Instance Attribute Details
#attributes ⇒ Object
Returns the value of attribute attributes.
4 5 6 |
# File 'lib/mercurius/gcm/notification.rb', line 4 def attributes @attributes end |
Instance Method Details
#==(that) ⇒ Object
14 15 16 |
# File 'lib/mercurius/gcm/notification.rb', line 14 def ==(that) attributes == that.attributes end |
#to_h ⇒ Object
10 11 12 |
# File 'lib/mercurius/gcm/notification.rb', line 10 def to_h @attributes end |