class Geode::CircularBuffer(T)

Included Modules

Defined in:

geode/circular_buffer.cr

Constructors

Instance Method Summary

Instance methods inherited from module Enumerable(T)

to_h_by(&) to_h_by

Constructor Detail

def self.new(capacity) #

[View source]

Instance Method Detail

def <<(value : T) #

[View source]
def capacity #

[View source]
def clear #

[View source]
def each(&) #
Description copied from module Enumerable(T)

Must yield this collection's elements to the block.


[View source]
def each_last(count, &) #

[View source]
def empty? #
Description copied from module Enumerable(T)

Returns true if self does not contain any element.

([] of Int32).empty? # => true
([1]).empty?         # => false
[nil, false].empty?  # => false
  • #present? returns the inverse.

[View source]
def full? : Bool #

[View source]
def push(value : T) #

[View source]
def size #
Description copied from module Enumerable(T)

Returns the number of elements in the collection.

[1, 2, 3, 4].size # => 4

[View source]
def to_s(io) #

[View source]