class Tumasms::Connection
Constants
- ENDPOINT
Public Class Methods
new(user, pass)
click to toggle source
# File lib/tumasms/connection.rb, line 7 def initialize(user, pass) @user, @pass = user, pass end
Public Instance Methods
get(url)
click to toggle source
# File lib/tumasms/connection.rb, line 11 def get(url) HTTParty.post("#{ENDPOINT}#{url}", headers: headers) end
post(url, params)
click to toggle source
# File lib/tumasms/connection.rb, line 15 def post(url, params) HTTParty.post("#{ENDPOINT}#{url}", body: params.merge(headers), headers: headers) end
put(url, params)
click to toggle source
# File lib/tumasms/connection.rb, line 19 def put(url, params) HTTParty.put("#{ENDPOINT}#{url}", body: params.merge(headers), headers: headers) end
Private Instance Methods
headers()
click to toggle source
# File lib/tumasms/connection.rb, line 25 def headers {api_key: @user, api_signature: @pass} end