Sha256: 423b56bc549c2e31674ca9abce6cbeb5d8d2b2fa1a7aea3a32c2647596da15c5

Contents?: true

Size: 579 Bytes

Versions: 2

Compression:

Stored size: 579 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, :ws_console
        @client = MKIt::WebSocketClient.new(server_url, my_id)
      else
        @client = MKIt::HttpClient.new(server_url, my_id)
      end
    end

    def request(request, request_data)
      # puts "Request: #{request}"
      # puts "Request data: #{request_data}"
      @client.request(request, request_data)
    end 
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
mkit-0.9.0 lib/mkit/client/mkitd_client.rb
mkit-0.8.0 lib/mkit/client/mkitd_client.rb