Module: L42::Map::Api

Included in:
L42::Map
Defined in:
lib/l42/map/api.rb

Instance Method Summary collapse

Instance Method Details

#[](key) ⇒ Object



6
7
8
# File 'lib/l42/map/api.rb', line 6

def [](key)
  hash[key]
end

#empty?Boolean

Returns:

  • (Boolean)


10
11
12
# File 'lib/l42/map/api.rb', line 10

def empty?
  hash.empty?
end

#fetch(*args, &blk) ⇒ Object



14
15
16
# File 'lib/l42/map/api.rb', line 14

def fetch(*args, &blk)
  hash.fetch(*args, &blk)
end

#merge(*args, &blk) ⇒ Object



18
19
20
21
# File 'lib/l42/map/api.rb', line 18

def merge(*args, &blk)
  hash1 = hash.merge(*args, &blk)
  _clone(hash1)
end

#slice(*keys) ⇒ Object



23
24
25
26
# File 'lib/l42/map/api.rb', line 23

def slice(*keys)
  hash1 = hash.slice(*keys)
  _clone(hash1)
end

#to_hObject



28
# File 'lib/l42/map/api.rb', line 28

def to_h; hash end

#without(*keys) ⇒ Object



30
31
32
# File 'lib/l42/map/api.rb', line 30

def without(*keys)
  slice(*(hash.keys - keys))
end