class AddArray

Attributes

left[RW]
right[RW]

Public Class Methods

new(left=[], right=[]) click to toggle source
# File lib/lazzay.rb, line 67
    def initialize(left=[], right=[])
    <<~DOC
        Arguments
        ------
        left: left side of +
        right: right side of +
    DOC
        @left, @right = left, right
    end

Public Instance Methods

[](k) click to toggle source
# File lib/lazzay.rb, line 77
def [](k)
    l = @left.length
    if k < l
        return @left[k]
    else
        return @right[k - l]
    end
end
to_s() click to toggle source
# File lib/lazzay.rb, line 86
def to_s
    "#{@left} + #{@right}"
end