Created
October 29, 2008 20:07
-
-
Save vinbarnes/20813 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
>> data = OpenStruct.new({:so => 'what', :what => 'ever'}) | |
=> #<OpenStruct so="what", what="ever"> | |
>> data.so | |
=> "what" | |
>> class << data; alias_method :old_so, :so; def so() old_so.upcase; end end | |
=> nil | |
>> data.so | |
=> "WHAT" | |
>> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment