Class: Utopia::Content::SymbolicHash
- Inherits:
-
Hash
- Object
- Hash
- Utopia::Content::SymbolicHash
- Defined in:
- lib/utopia/content/markup.rb
Instance Method Summary collapse
- #[](key) ⇒ Object
- #[]=(key, value) ⇒ Object
- #fetch(key, *args, &block) ⇒ Object
- #include?(key) ⇒ Boolean
Instance Method Details
#[](key) ⇒ Object
29 30 31 32 |
# File 'lib/utopia/content/markup.rb', line 29 def [] key raise KeyError.new("attribute #{key} is a string, prefer a symbol") if key.is_a? String super key.to_sym end |
#[]=(key, value) ⇒ Object
34 35 36 |
# File 'lib/utopia/content/markup.rb', line 34 def []= key, value super key.to_sym, value end |
#fetch(key, *args, &block) ⇒ Object
38 39 40 41 42 |
# File 'lib/utopia/content/markup.rb', line 38 def fetch(key, *args, &block) key = key.to_sym super end |
#include?(key) ⇒ Boolean
44 45 46 47 48 |
# File 'lib/utopia/content/markup.rb', line 44 def include? key key = key.to_sym super end |