diff options
author | Akira Matsuda <ronnie@dio.jp> | 2016-12-22 19:16:38 +0900 |
---|---|---|
committer | Akira Matsuda <ronnie@dio.jp> | 2016-12-24 22:16:43 +0900 |
commit | 91fa2b71c3fecb26a1dc7836874478f12e6d7a02 (patch) | |
tree | de3287d0dda38a9cc3f6815f086b92d2bce1e523 /actioncable/lib/action_cable/connection | |
parent | 102ee4055770813c847c95d3d6ff8741c33597d8 (diff) | |
download | rails-91fa2b71c3fecb26a1dc7836874478f12e6d7a02.tar.gz rails-91fa2b71c3fecb26a1dc7836874478f12e6d7a02.tar.bz2 rails-91fa2b71c3fecb26a1dc7836874478f12e6d7a02.zip |
Privatize unneededly protected methods in Action Cable
Diffstat (limited to 'actioncable/lib/action_cable/connection')
-rw-r--r-- | actioncable/lib/action_cable/connection/base.rb | 14 | ||||
-rw-r--r-- | actioncable/lib/action_cable/connection/tagged_logger_proxy.rb | 4 |
2 files changed, 9 insertions, 9 deletions
diff --git a/actioncable/lib/action_cable/connection/base.rb b/actioncable/lib/action_cable/connection/base.rb index 6d94b0eab0..0a517a532d 100644 --- a/actioncable/lib/action_cable/connection/base.rb +++ b/actioncable/lib/action_cable/connection/base.rb @@ -22,7 +22,7 @@ module ActionCable # # Any cleanup work needed when the cable connection is cut. # end # - # protected + # private # def find_verified_user # User.find_by_identity(cookies.signed[:identity_id]) || # reject_unauthorized_connection @@ -136,8 +136,12 @@ module ActionCable # TODO Change this to private once we've dropped Ruby 2.2 support. # Workaround for Ruby 2.2 "private attribute?" warning. protected + attr_reader :websocket + attr_reader :message_buffer + + private # The request that initiated the WebSocket connection is available here. This gives access to the environment, cookies, etc. - def request + def request # :doc: @request ||= begin environment = Rails.application.env_config.merge(env) if defined?(Rails.application) && Rails.application ActionDispatch::Request.new(environment || env) @@ -145,14 +149,10 @@ module ActionCable end # The cookies of the request that initiated the WebSocket connection. Useful for performing authorization checks. - def cookies + def cookies # :doc: request.cookie_jar end - attr_reader :websocket - attr_reader :message_buffer - - private def encode(cable_message) @coder.encode cable_message end diff --git a/actioncable/lib/action_cable/connection/tagged_logger_proxy.rb b/actioncable/lib/action_cable/connection/tagged_logger_proxy.rb index 41afa9680a..aef549aa86 100644 --- a/actioncable/lib/action_cable/connection/tagged_logger_proxy.rb +++ b/actioncable/lib/action_cable/connection/tagged_logger_proxy.rb @@ -31,8 +31,8 @@ module ActionCable end end - protected - def log(type, message) + private + def log(type, message) # :doc: tag(@logger) { @logger.send type, message } end end |