Class: Smsapi::Server::Connection

Inherits:
Object
  • Object
show all
Defined in:
lib/smsapi/server/connection.rb

Instance Method Summary collapse

Constructor Details

#initialize(uri, port, token) ⇒ Connection

Returns a new instance of Connection.



7
8
9
10
11
12
# File 'lib/smsapi/server/connection.rb', line 7

def initialize(uri, port, token)
  @http = Net::HTTP.new(uri, port)
  @http.use_ssl = true
  @http.verify_mode = OpenSSL::SSL::VERIFY_NONE
  @token = token
end

Instance Method Details

#post(path, params) ⇒ Object



14
15
16
# File 'lib/smsapi/server/connection.rb', line 14

def post(path, params)
  @http.request post_request(path, params)
end