Class: RiderServer::Utils::FixedArray
- Defined in:
- lib/rider_server/utils.rb
Instance Method Summary collapse
- #<<(element) ⇒ Object (also: #push)
-
#initialize(*args, max_size: 10) ⇒ FixedArray
constructor
A new instance of FixedArray.
Methods inherited from Array
Constructor Details
#initialize(*args, max_size: 10) ⇒ FixedArray
Returns a new instance of FixedArray.
43 44 45 46 |
# File 'lib/rider_server/utils.rb', line 43 def initialize(*args, max_size: 10) @max_size = max_size super(*args) end |
Instance Method Details
#<<(element) ⇒ Object Also known as: push
48 49 50 51 |
# File 'lib/rider_server/utils.rb', line 48 def <<(element) super shift while size > @max_size end |