Class: Userlist::Push::Client

Inherits:
Object
  • Object
show all
Includes:
Logging
Defined in:
lib/userlist/push/client.rb

Instance Method Summary collapse

Methods included from Logging

included, #logger

Constructor Details

#initialize(config = {}) ⇒ Client

Returns a new instance of Client.



11
12
13
# File 'lib/userlist/push/client.rb', line 11

def initialize(config = {})
  @config = Userlist.config.merge(config)
end

Instance Method Details

#delete(endpoint) ⇒ Object



27
28
29
# File 'lib/userlist/push/client.rb', line 27

def delete(endpoint)
  request(Net::HTTP::Delete, endpoint)
end

#get(endpoint) ⇒ Object



15
16
17
# File 'lib/userlist/push/client.rb', line 15

def get(endpoint)
  request(Net::HTTP::Get, endpoint)
end

#post(endpoint, payload = nil) ⇒ Object



19
20
21
# File 'lib/userlist/push/client.rb', line 19

def post(endpoint, payload = nil)
  request(Net::HTTP::Post, endpoint, payload)
end

#put(endpoint, payload = nil) ⇒ Object



23
24
25
# File 'lib/userlist/push/client.rb', line 23

def put(endpoint, payload = nil)
  request(Net::HTTP::Put, endpoint, payload)
end