Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class SpecialHash < Hash
- def method_missing(method_sym, *arguments, &block)
- if self.include? method_sym
- self[method_sym]
- else
- super
- end
- end
- def respond_to?(method_sym, include_private = false)
- if self.include? method_sym
- true
- else
- super
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment