Class: LoggoRails::Client

Inherits:
Object
  • Object
show all
Defined in:
lib/loggo_rails/client.rb

Constant Summary collapse

API_URL =
'http://localhost:3579'.freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeClient

Returns a new instance of Client.



7
8
9
# File 'lib/loggo_rails/client.rb', line 7

def initialize
  @token = Rails.configuration.loggo_rails.token
end

Instance Attribute Details

#tokenObject (readonly)

Returns the value of attribute token.



5
6
7
# File 'lib/loggo_rails/client.rb', line 5

def token
  @token
end

Instance Method Details

#insert(options) ⇒ Object



11
12
13
14
15
16
17
18
19
# File 'lib/loggo_rails/client.rb', line 11

def insert(options)
  RestClient::Request.execute(
    headers: client_headers,
    method: :put,
    url: insert_url,
    payload: options.to_json,
    verify_ssl: false
  )
end