Class: Logux::Client

Inherits:
Object
  • Object
show all
Includes:
Test::Client
Defined in:
lib/logux/client.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(logux_host: Logux.configuration.logux_host) ⇒ Client

Returns a new instance of Client.



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

def initialize(logux_host: Logux.configuration.logux_host)
  @logux_host = logux_host
end

Instance Attribute Details

#logux_hostObject (readonly)

Returns the value of attribute logux_host.



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

def logux_host
  @logux_host
end

Instance Method Details

#clientObject



17
18
19
# File 'lib/logux/client.rb', line 17

def client
  @client ||= RestClient::Resource.new(logux_host, verify_ssl: false)
end

#post(params) ⇒ Object



11
12
13
14
15
# File 'lib/logux/client.rb', line 11

def post(params)
  client.post(params.to_json,
              content_type: :json,
              accept: :json)
end