Class: Hash

Inherits:
Object
  • Object
show all
Defined in:
lib/butterfly/core/hash.rb

Overview

So we can call methods directory on the hash object rather than having to call [] on it.

Instance Method Summary collapse

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(m, *a, &block) ⇒ Object



4
5
6
7
8
9
10
# File 'lib/butterfly/core/hash.rb', line 4

def method_missing(m,*a,&block)
  if has_key?(m)
    self[m]
  else
    super
  end
end