Class: L42::Map

Inherits:
Object
  • Object
show all
Includes:
Api, EnumerableApi, PatternMatchingApi
Defined in:
lib/l42/map.rb,
lib/l42/map/api.rb,
lib/l42/map/version.rb,
lib/l42/map/enumerable_api.rb,
lib/l42/map/pattern_matching_api.rb

Defined Under Namespace

Modules: Api, EnumerableApi, PatternMatchingApi

Constant Summary collapse

RestrictedNames =
%i[
empty? fetch merge slice to_h with_default without
].freeze
VERSION =
'0.1.1'

Instance Method Summary collapse

Methods included from PatternMatchingApi

#deconstruct_keys

Methods included from EnumerableApi

#each

Methods included from Api

#[], #empty?, #fetch, #merge, #slice, #to_h, #without

Instance Method Details

#==(other) ⇒ Object



16
17
18
# File 'lib/l42/map.rb', line 16

def ==(other)
  self.class == other.class && hash == other.to_h
end

#with_default(default) ⇒ Object



20
21
22
23
24
# File 'lib/l42/map.rb', line 20

def with_default(default)
  @default = default
  _define_method_missing
  self
end