Skip to content

Commit

Permalink
Address a few legitimate warnings about redefined methods
Browse files Browse the repository at this point in the history
It's mostly cosmetics but nice to address.

References #563
  • Loading branch information
michaelklishin committed Aug 22, 2018
1 parent cf2b1a4 commit 2bd2482
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 17 deletions.
15 changes: 5 additions & 10 deletions lib/bunny/channel.rb
Original file line number Diff line number Diff line change
Expand Up @@ -265,15 +265,6 @@ def closed?
@status == :closed
end

def to_s
oid = ("0x%x" % (self.object_id << 1))
"<#{self.class.name}:#{oid} number=#{@channel.id} @open=#{open?} connection=#{@connection.to_s}>"
end

def inspect
to_s
end

#
# @group Backwards compatibility with 0.8.0
#
Expand Down Expand Up @@ -1589,7 +1580,11 @@ def recovers_cancelled_consumers?

# @return [String] Brief human-readable representation of the channel
def to_s
"#<#{self.class.name}:#{object_id} @id=#{self.number} @connection=#{@connection.to_s}>"
"#<#{self.class.name}:#{object_id} @id=#{self.number} @connection=#{@connection.to_s}> @open=#{open?}"
end

def inspect
to_s
end


Expand Down
5 changes: 0 additions & 5 deletions lib/bunny/queue.rb
Original file line number Diff line number Diff line change
Expand Up @@ -375,11 +375,6 @@ def declare!

protected

# @private
def self.add_default_options(name, opts, block)
{ :queue => name, :nowait => (block.nil? && !name.empty?) }.merge(opts)
end

# @private
def self.add_default_options(name, opts)
# :nowait is always false for Bunny
Expand Down
2 changes: 1 addition & 1 deletion lib/bunny/session.rb
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ class Session

# @return [Bunny::Transport]
attr_reader :transport
attr_reader :status, :port, :heartbeat, :user, :pass, :vhost, :frame_max, :channel_max, :threaded
attr_reader :status, :heartbeat, :user, :pass, :vhost, :frame_max, :channel_max, :threaded
attr_reader :server_capabilities, :server_properties, :server_authentication_mechanisms, :server_locales
attr_reader :channel_id_allocator
# Authentication mechanism, e.g. "PLAIN" or "EXTERNAL"
Expand Down
1 change: 0 additions & 1 deletion lib/bunny/transport.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ class Transport
attr_reader :session, :host, :port, :socket, :connect_timeout, :read_timeout, :write_timeout, :disconnect_timeout
attr_reader :tls_context, :verify_peer, :tls_ca_certificates, :tls_certificate_path, :tls_key_path

attr_writer :read_timeout
def read_timeout=(v)
@read_timeout = v
@read_timeout = nil if @read_timeout == 0
Expand Down

0 comments on commit 2bd2482

Please sign in to comment.