Class: ForwardArray

Inherits:
LazyArray show all
Defined in:
lib/lazzay.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from LazyArray

#+

Methods inherited from Array

#+

Constructor Details

#initialize(subarray = []) ⇒ ForwardArray

Returns a new instance of ForwardArray.



37
38
39
# File 'lib/lazzay.rb', line 37

def initialize(subarray=[])
    @subarray = subarray
end

Instance Attribute Details

#subarrayObject

Returns the value of attribute subarray.



35
36
37
# File 'lib/lazzay.rb', line 35

def subarray
  @subarray
end

Instance Method Details

#<=(other) ⇒ Object



45
46
47
# File 'lib/lazzay.rb', line 45

def <=(other)
    @subarray = other
end

#[](k) ⇒ Object



41
42
43
# File 'lib/lazzay.rb', line 41

def [](k)
    @subarray[k]
end

#to_sObject



49
50
51
# File 'lib/lazzay.rb', line 49

def to_s
    "ForwardArray"
end