lib/slack/real_time/concurrency/eventmachine.rb in slack-ruby-client-0.14.4 vs lib/slack/real_time/concurrency/eventmachine.rb in slack-ruby-client-0.14.5
- old
+ new
@@ -1,18 +1,17 @@
+# frozen_string_literal: true
require 'faye/websocket'
require 'eventmachine'
module Slack
module RealTime
module Concurrency
module Eventmachine
class Client < Faye::WebSocket::Client
- attr_reader :logger
- protected :logger
-
def initialize(url, protocols = nil, options = {})
- @logger = options.fetch(:logger) || Slack::RealTime::Config.logger || Slack::Config.logger
+ @logger =
+ options.fetch(:logger) || Slack::RealTime::Config.logger || Slack::Config.logger
super url, protocols, options.except(:logger)
end
def parse(data)
logger.debug("#{self.class}##{__method__}") { data }
@@ -21,9 +20,13 @@
def write(data)
logger.debug("#{self.class}##{__method__}") { data }
super data
end
+
+ protected
+
+ attr_reader :logger
end
class Socket < Slack::RealTime::Socket
def start_async(client)
@thread = ensure_reactor_running