Class: Userlist::Push::Message

Inherits:
Resource
  • Object
show all
Includes:
Operations::Create
Defined in:
lib/userlist/push/message.rb

Instance Attribute Summary

Attributes inherited from Resource

#config, #payload

Instance Method Summary collapse

Methods included from Operations::Create

#create?, included

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

Returns:

  • (Boolean)


14
15
16
# File 'lib/userlist/push/message.rb', line 14

def push?
  super && (user.nil? || user.push?)
end