Skip to content

Commit

Permalink
Breadcrumbs/Circular buffer docs: Improve readability
Browse files Browse the repository at this point in the history
  • Loading branch information
Cawllec committed Dec 7, 2018
1 parent 2e3e125 commit 1e8d969
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions lib/bugsnag/utility/circular_buffer.rb
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
module Bugsnag::Utility
##
# A container class with a maximum size, that removes oldest items as required.
#
# @api private
class CircularBuffer
include Enumerable

# @return [Numeric] the current maximum allowable number of items
# @return [Integer] the current maximum allowable number of items
attr_reader :max_items

##
# Creates a circular buffer
#
# @api private
#
# @param max_items [Integer] the initial maximum number of items
def initialize(max_items = 25)
@max_items = max_items
Expand All @@ -21,7 +21,7 @@ def initialize(max_items = 25)
#
# If this causes the buffer to exceed its maximum items, the oldest item will be removed
#
# @param item [Any] the item to add to the buffer
# @param item [Object] the item to add to the buffer
# @return [self] returns itself to allow method chaining
def <<(item)
@buffer << item
Expand All @@ -32,7 +32,7 @@ def <<(item)
##
# Iterates over the buffer
#
# @yield [item] sequentially gives stored items to the block
# @yield [Object] sequentially gives stored items to the block
def each(&block)
@buffer.each(&block)
end
Expand Down

0 comments on commit 1e8d969

Please sign in to comment.