Class: BoundedArray
- Inherits:
-
Array
- Object
- Array
- BoundedArray
- Defined in:
- lib/ruby-state-machine/bounded_array.rb
Instance Attribute Summary collapse
-
#bounded_size ⇒ Object
Returns the value of attribute bounded_size.
Instance Method Summary collapse
Instance Attribute Details
#bounded_size ⇒ Object
Returns the value of attribute bounded_size.
2 3 4 |
# File 'lib/ruby-state-machine/bounded_array.rb', line 2 def bounded_size @bounded_size end |
Instance Method Details
#push(args) ⇒ Object
3 4 5 6 7 |
# File 'lib/ruby-state-machine/bounded_array.rb', line 3 def push(args) super @bounded_size ||= 10 shift until size <= bounded_size end |