Class: Icalendar::DowncasedHash
- Inherits:
-
SimpleDelegator
- Object
- SimpleDelegator
- Icalendar::DowncasedHash
- Defined in:
- lib/icalendar/downcased_hash.rb
Instance Method Summary collapse
- #[](key) ⇒ Object
- #[]=(key, value) ⇒ Object
- #delete(key, &block) ⇒ Object
- #has_key?(key) ⇒ Boolean (also: #include?, #member?)
-
#initialize(base) ⇒ DowncasedHash
constructor
A new instance of DowncasedHash.
Constructor Details
#initialize(base) ⇒ DowncasedHash
Returns a new instance of DowncasedHash.
6 7 8 9 10 11 |
# File 'lib/icalendar/downcased_hash.rb', line 6 def initialize(base) super Hash.new base.each do |key, value| self[key] = value end end |
Instance Method Details
#[](key) ⇒ Object
17 18 19 |
# File 'lib/icalendar/downcased_hash.rb', line 17 def [](key) __getobj__[key.to_s.downcase] end |
#[]=(key, value) ⇒ Object
13 14 15 |
# File 'lib/icalendar/downcased_hash.rb', line 13 def []=(key, value) __getobj__[key.to_s.downcase] = value end |
#delete(key, &block) ⇒ Object
27 28 29 |
# File 'lib/icalendar/downcased_hash.rb', line 27 def delete(key, &block) __getobj__.delete key.to_s.downcase, &block end |
#has_key?(key) ⇒ Boolean Also known as: include?, member?
21 22 23 |
# File 'lib/icalendar/downcased_hash.rb', line 21 def has_key?(key) __getobj__.has_key? key.to_s.downcase end |