Class: RubyVibe::Client
- Inherits:
-
Object
- Object
- RubyVibe::Client
- Defined in:
- lib/ruby_vibe/client.rb
Instance Attribute Summary collapse
-
#token ⇒ Object
Returns the value of attribute token.
Instance Method Summary collapse
- #action(url, payload: {}, http_method: :post) ⇒ Object
-
#initialize(auth_token:) ⇒ Client
constructor
A new instance of Client.
Constructor Details
Instance Attribute Details
#token ⇒ Object
Returns the value of attribute token.
7 8 9 |
# File 'lib/ruby_vibe/client.rb', line 7 def token @token end |
Instance Method Details
#action(url, payload: {}, http_method: :post) ⇒ Object
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
# 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 ) return_response(response) end |