Class: Userlist::Push::Message
- Includes:
- Operations::Create
- 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::Create
Methods inherited from Resource
#attribute_names, endpoint, #eql?, from_payload, #hash, #identifier, relationship_names, #relationship_names, relationships, resource_name, #respond_to_missing?, #to_hash, #to_json
Constructor Details
#initialize(payload = {}, config = Userlist.config) ⇒ Message
Returns a new instance of Message.
8 9 10 11 12 |
# File 'lib/userlist/push/message.rb', line 8 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
14 15 16 |
# File 'lib/userlist/push/message.rb', line 14 def push? super && (user.nil? || user.push?) end |