Class: Hash

Inherits:
Object
  • Object
show all
Defined in:
lib/rdoc/ri/driver.rb

Overview

HACK don’t add stuff to Hash.

Instance Method Summary collapse

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(method, *args) ⇒ Object



426
427
428
# File 'lib/rdoc/ri/driver.rb', line 426

def method_missing method, *args
  self[method.to_s]
end

Instance Method Details

#merge_enums(other) ⇒ Object



430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
# File 'lib/rdoc/ri/driver.rb', line 430

def merge_enums(other)
  other.each do |k,v|
    if self[k] then
      case v
      when Array then
        # HACK dunno
        if String === self[k] and self[k].empty? then
          self[k] = v
        else
          self[k] += v
        end
      when Hash then
        self[k].merge! v
      else
        # do nothing
      end
    else
      self[k] = v
    end
  end
end