Create a gist now

Instantly share code, notes, and snippets.

Object.const_defined? :Integer
#=> true
class Integer
#...
end
def Integer(value)
#...
end
Object.private_method_defined? :Integer
#=> true
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
Integer.class
#=> Class
Integer(1)
#=> 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment