Module: Elixir::Tuple

Defined in:
lib/elixir/tuple.rb

Class Method Summary collapse

Class Method Details

.delete_at(array, index) ⇒ Object



5
6
7
8
9
# File 'lib/elixir/tuple.rb', line 5

def delete_at array, index
  array.delete_at index

  array
end

.duplicate(data, size) ⇒ Object



11
12
13
# File 'lib/elixir/tuple.rb', line 11

def duplicate data, size
  Array.new size, data
end

.insert_at(array, index, value) ⇒ Object



15
16
17
# File 'lib/elixir/tuple.rb', line 15

def insert_at array, index, value
  array.insert index, value
end

.to_list(array) ⇒ Object



19
20
21
# File 'lib/elixir/tuple.rb', line 19

def to_list array
  array.to_a
end