Class: Userlist::Push::Company

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

Instance Attribute Summary

Attributes inherited from Resource

#config, #payload

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Operations::Delete

#delete?, included

Methods included from Operations::Create

#create?, included

Methods inherited from Resource

#attribute_names, #eql?, from_payload, #hash, #identifier, #push?, relationship_names, #relationship_names, resource_name, #respond_to_missing?, #to_hash, #to_json, #url

Constructor Details

#initialize(payload = {}, config = Userlist.config) ⇒ Company

Returns a new instance of Company.



15
16
17
18
19
20
# File 'lib/userlist/push/company.rb', line 15

def initialize(payload = {}, config = Userlist.config)
  raise Userlist::ArgumentError, 'Missing required payload hash' unless payload
  raise Userlist::ArgumentError, 'Missing required parameter :identifier' unless payload[:identifier]

  super
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Userlist::Push::Resource

Class Method Details

.endpointObject



7
8
9
# File 'lib/userlist/push/company.rb', line 7

def self.endpoint
  '/companies'
end