class RubyVibe::Client
Attributes
token[RW]
Public Class Methods
new(auth_token:)
click to toggle source
# File lib/ruby-vibe/client.rb, line 9 def initialize(auth_token:) RubyVibe.configure @token = auth_token || RubyVibe.config.auth_token end
Public Instance Methods
action(url, payload: {}, http_method: :post)
click to toggle source
# File lib/ruby-vibe/client.rb, line 15 def action(url, payload: {}, http_method: :post) headers = { 'User-Agent': "RubyVibe client v#{RubyVibe::VERSION})", 'X-Viber-Auth-Token': token } response = ::RestClient::Request.execute( method: http_method, url: url, payload: payload.to_json, headers: headers, timeout: 5, verify_ssl: ::OpenSSL::SSL::VERIFY_NONE ) RubyVibe::Response.parse(response) end