Class: Cooklang::Metadata
- Inherits:
-
Hash
- Object
- Hash
- Cooklang::Metadata
- Defined in:
- lib/cooklang/metadata.rb
Instance Method Summary collapse
- #[](key) ⇒ Object
- #[]=(key, value) ⇒ Object
- #delete(key) ⇒ Object
- #fetch(key, *args) ⇒ Object
-
#initialize(data = {}) ⇒ Metadata
constructor
A new instance of Metadata.
- #key?(key) ⇒ Boolean
- #to_h ⇒ Object
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
18 19 20 |
# File 'lib/cooklang/metadata.rb', line 18 def key?(key) super(key.to_s) end |
#to_h ⇒ Object
30 31 32 |
# File 'lib/cooklang/metadata.rb', line 30 def to_h super end |