Class: Hash

Inherits:
Object show all
Defined in:
lib/orange-core/magick.rb,
lib/orange-core/magick.rb

Direct Known Subclasses

Orange::DefaultHash

Instance Method Summary collapse

Instance Method Details

#with_defaults(defaults) ⇒ Object

:nodoc:



18
19
20
# File 'lib/orange-core/magick.rb', line 18

def with_defaults(defaults) 
  self.merge(defaults){ |key, old, new| old.nil? ? new : old } 
end

#with_defaults!(defaults) ⇒ Object



21
22
23
# File 'lib/orange-core/magick.rb', line 21

def with_defaults!(defaults) 
  self.merge!(defaults){ |key, old, new| old.nil? ? new : old } 
end