Created
October 18, 2011 05:52
-
-
Save abyx/1294707 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
| Object.const_defined? :Integer | |
| #=> true |
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
| class Integer | |
| #... | |
| end | |
| def Integer(value) | |
| #... | |
| end |
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
| Object.private_method_defined? :Integer | |
| #=> true |
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
| class MyClass: | |
| def __init__(self, value): | |
| self.value = value | |
| my_class = MyClass(1) # We are calling the class to get | |
| # an instance, instead of | |
| # MyClass.new(1) in Ruby |
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
| Integer.class | |
| #=> Class | |
| Integer(1) | |
| #=> 1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment