Skip to content

Instantly share code, notes, and snippets.

@yudai
Created January 25, 2013 06:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yudai/4632334 to your computer and use it in GitHub Desktop.
Save yudai/4632334 to your computer and use it in GitHub Desktop.
class PropertyChain
def initialize(value)
@value = value
end
def method_missing(action, *args)
if @value.key?(action)
PropertyChain.new(@value[action])
else
nil
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment