Class: Array

Inherits:
Object
  • Object
show all
Defined in:
lib/lazzay.rb

Overview

Lazy Array

Example


b = ForwardArray.new b <= [1, 2] + b

puts b.to_s puts b => 2

Direct Known Subclasses

LazyArray

Instance Method Summary collapse

Instance Method Details

#+(other) ⇒ Object



14
15
16
17
18
19
20
# File 'lib/lazzay.rb', line 14

def +(other)
    if other.is_a?(LazyArray)
        AddArray.new(self, other)
    else
        super
    end
end