Class: Maia::FCM::Connection

Inherits:
Object
  • Object
show all
Defined in:
lib/maia/fcm/connection.rb

Instance Method Summary collapse

Constructor Details

#initialize(project, token) ⇒ Connection

Returns a new instance of Connection.


4
5
6
7
# File 'lib/maia/fcm/connection.rb', line 4

def initialize(project, token)
  @project = project
  @token   = token
end

Instance Method Details

#write(payload = {}) ⇒ Object


9
10
11
12
13
# File 'lib/maia/fcm/connection.rb', line 9

def write(payload = {})
  request = Net::HTTP::Post.new uri, headers
  request.body = payload
  http.request request
end