Sha256: 2b79ca315b564be8d87f5e1695d3e4d79f439518dacf67c987b6fe37062d4e9f

Contents?: true

Size: 486 Bytes

Versions: 3

Compression:

Stored size: 486 Bytes

Contents

# frozen_string_literal: true
require 'mkit/client/http_client'
require 'mkit/client/websocket_client'

module MKIt
  class MKItdClient
    def initialize(request, server_url, my_id)
      case request[:verb].to_sym
      when :ws
        @client = MKIt::WebSocketClient.new(server_url, my_id)
      else
        @client = MKIt::HttpClient.new(server_url, my_id)
      end
    end

    def request(request, request_data)
      @client.request(request, request_data)
    end 
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
mkit-0.7.2 lib/mkit/client/mkitd_client.rb
mkit-0.7.1 lib/mkit/client/mkitd_client.rb
mkit-0.7.0 lib/mkit/client/mkitd_client.rb