Module: Mikon::UseArray

Defined in:
lib/mikon/core/array.rb

Instance Method Summary collapse

Instance Method Details

#expand(length) ⇒ Object



135
136
137
# File 'lib/mikon/core/array.rb', line 135

def expand(length)
  @data = @data + Array(length - @data.length, 0)
end

#lengthObject



139
140
141
# File 'lib/mikon/core/array.rb', line 139

def length
  @data.length
end

#reduce(init, &block) ⇒ Object



143
144
145
# File 'lib/mikon/core/array.rb', line 143

def reduce(init, &block)
  @data.reduce(int, &block)
end