Module: Elixir::Dict

Defined in:
lib/elixir/dict.rb

Class Method Summary collapse

Class Method Details

.delete(list, key) ⇒ Object



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

def delete list, key
  list.delete key

  list
end

.drop(list, keys) ⇒ Object



11
12
13
14
15
16
17
# File 'lib/elixir/dict.rb', line 11

def drop list, keys
  keys.each do |key|
    list.delete key
  end

  list
end

.equal?(dict1, dict2) ⇒ Boolean

Returns:

  • (Boolean)


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

def equal? dict1, dict2
  dict1.eql? dict2
end

.fetch(dict, key) ⇒ Object



23
24
25
# File 'lib/elixir/dict.rb', line 23

def fetch dict, key
  dict.fetch(key) rescue nil
end

.fetch!Object



27
28
29
# File 'lib/elixir/dict.rb', line 27

def fetch!
  dict.fetch key
end

.get(dict, key, default = nil) ⇒ Object



31
32
33
# File 'lib/elixir/dict.rb', line 31

def get dict, key, default = nil
  # TODO
end

.hash_key?(dict, key) ⇒ Boolean

Returns:

  • (Boolean)


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

def hash_key? dict, key
  # TODO
end

.keys(dict) ⇒ Object



39
40
41
# File 'lib/elixir/dict.rb', line 39

def keys dict
  # TODO
end

.merge(dict1, dict2, fun = -> _k, _v1, v2 { v2 }) ⇒ Object



43
44
45
# File 'lib/elixir/dict.rb', line 43

def merge dict1, dict2, fun = -> _k, _v1, v2 { v2 }
  # TODO
end

.pop(dict, key, default = nil) ⇒ Object



47
48
49
# File 'lib/elixir/dict.rb', line 47

def pop dict, key, default = nil
  # TODO
end

.put(dict, key, val) ⇒ Object



51
52
53
# File 'lib/elixir/dict.rb', line 51

def put dict, key, val
  # TODO
end

.put_new(dict, key, val) ⇒ Object



55
56
57
# File 'lib/elixir/dict.rb', line 55

def put_new dict, key, val
  # TODO
end

.size(dict) ⇒ Object



59
60
61
# File 'lib/elixir/dict.rb', line 59

def size dict
  # TODO
end

.split(dict, keys) ⇒ Object



63
64
65
# File 'lib/elixir/dict.rb', line 63

def split dict, keys
  # TODO
end

.take(dict, keys) ⇒ Object



67
68
69
# File 'lib/elixir/dict.rb', line 67

def take dict, keys
  # TODO
end

.to_list(dict) ⇒ Object



71
72
73
# File 'lib/elixir/dict.rb', line 71

def to_list dict
  # TODO
end

.update(dict, key, initial, fun) ⇒ Object



75
76
77
# File 'lib/elixir/dict.rb', line 75

def update dict, key, initial, fun
  # TODO
end

.update!(dict, key, fun) ⇒ Object



79
80
81
# File 'lib/elixir/dict.rb', line 79

def update! dict, key, fun
  # TODO
end

.values(dict) ⇒ Object



83
84
85
# File 'lib/elixir/dict.rb', line 83

def values dict
  # TODO
end