Sha256: c91a32e12b5301f34ffc80af077d6b5cd55a8c22108e379f93c5ea8f4a5fe75c
Contents?: true
Size: 410 Bytes
Versions: 2
Compression:
Stored size: 410 Bytes
Contents
module DaruLite class Vector module Joinable # Append an element to the vector by specifying the element and index def concat(element, index) raise IndexError, 'Expected new unique index' if @index.include? index @index |= [index] @data[@index[index]] = element update_position_cache end alias push concat alias << concat end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
daru_lite-0.1.3 | lib/daru_lite/vector/joinable.rb |
daru_lite-0.1.2 | lib/daru_lite/vector/joinable.rb |