Class: Cooklang::Metadata

Inherits:
Hash
  • Object
show all
Defined in:
lib/cooklang/metadata.rb

Instance Method Summary collapse

Constructor Details

#initialize(data = {}) ⇒ Metadata

Returns a new instance of Metadata.



5
6
7
8
# File 'lib/cooklang/metadata.rb', line 5

def initialize(data = {})
  super()
  data.each { |key, value| self[key.to_s] = value }
end

Instance Method Details

#[](key) ⇒ Object



14
15
16
# File 'lib/cooklang/metadata.rb', line 14

def [](key)
  super(key.to_s)
end

#[]=(key, value) ⇒ Object



10
11
12
# File 'lib/cooklang/metadata.rb', line 10

def []=(key, value)
  super(key.to_s, value)
end

#delete(key) ⇒ Object



22
23
24
# File 'lib/cooklang/metadata.rb', line 22

def delete(key)
  super(key.to_s)
end

#fetch(key, *args) ⇒ Object



26
27
28
# File 'lib/cooklang/metadata.rb', line 26

def fetch(key, *args)
  super(key.to_s, *args)
end

#key?(key) ⇒ Boolean

Returns:

  • (Boolean)


18
19
20
# File 'lib/cooklang/metadata.rb', line 18

def key?(key)
  super(key.to_s)
end

#to_hObject



30
31
32
# File 'lib/cooklang/metadata.rb', line 30

def to_h
  super
end