Sha256: b3d91f46761942db3bb7bd22c1da4e82c6a5301b34d7eef53bd2989efa0fa6ed

Contents?: true

Size: 434 Bytes

Versions: 2

Compression:

Stored size: 434 Bytes

Contents

# frozen_string_literal: true

module Logux
  class Client
    attr_reader :logux_host

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

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

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

Version data entries

2 entries across 2 versions & 2 rubygems

Version Path
logux-rack-0.1.0 lib/logux/client.rb
logux_rails-0.1.0 lib/logux/client.rb