Class: Orange::DefaultHash
Overview
Class that extends hash so that [] can have an optional second attribute
Instance Method Summary collapse
Methods inherited from Hash
#with_defaults, #with_defaults!
Instance Method Details
#[](key, my_default = nil) ⇒ Object
126 127 128 129 |
# File 'lib/orange-core/magick.rb', line 126 def [](key, my_default = nil) my_default = self.default if my_default.nil? self.has_key?(key) ? super(key) : my_default end |