Skip to content

Commit

Permalink
Caesars::Hash method missing now correctly returns hash values for e…
Browse files Browse the repository at this point in the history
…lement keys which are Strings.
  • Loading branch information
delano committed Jun 13, 2009
1 parent effe9dd commit ac1f1f9
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions lib/caesars/hash.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,10 @@
#
class Caesars
class Hash < HASH_TYPE

def method_missing(meth)
self[meth] if self.has_key?(meth)
STDERR.puts "Caesars::Hash.method_missing: #{meth}" if Caesars.debug?
self[meth] || self[meth.to_s]
end

# Returns a clone of itself and all children cast as ::Hash objects
Expand All @@ -26,6 +28,10 @@ def to_hash(hash=self)
end
target
end


def __class__
HASH_TYPE
end

end
end

0 comments on commit ac1f1f9

Please sign in to comment.