Created
December 27, 2013 06:15
-
-
Save cowboy-cod3r/8143265 to your computer and use it in GitHub Desktop.
Ruby: Open Classes The concpet of extending existing classes in ruby (including those in the standard library) is called Open Classes. Here is an example.
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
# Extend the String class with a new method called my_new_method | |
class String | |
def my_new_method() | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment