Class: Userlist::Push::Message
- Includes:
- Operations::Push
- Defined in:
- lib/userlist/push/message.rb
Instance Attribute Summary
Attributes inherited from Resource
Instance Method Summary collapse
-
#initialize(payload = {}, config = Userlist.config) ⇒ Message
constructor
A new instance of Message.
- #push? ⇒ Boolean
Methods included from Operations::Push
Methods inherited from Resource
association_names, #association_names, associations, #attribute_names, endpoint, #eql?, #for_context, from_payload, #hash, #identifier, resource_name, #respond_to_missing?, #to_hash, #to_json
Constructor Details
#initialize(payload = {}, config = Userlist.config) ⇒ Message
Returns a new instance of Message.
9 10 11 12 13 |
# File 'lib/userlist/push/message.rb', line 9 def initialize(payload = {}, config = Userlist.config) raise Userlist::ArgumentError, 'Missing required payload' unless payload super end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Userlist::Push::Resource
Instance Method Details
#push? ⇒ Boolean
15 16 17 |
# File 'lib/userlist/push/message.rb', line 15 def push? super && (user.nil? || user.push?) end |