Created

Embed URL

HTTPS clone URL

SSH clone URL

You can clone with HTTPS or SSH.

Download Gist
View const_lookup.rb
1 2 3 4 5 6 7
class Integer
#...
end
 
def Integer(value)
#...
end
View const_lookup.rb
1 2
Object.private_method_defined? :Integer
#=> true
View const_lookup.rb
1 2 3 4 5 6 7
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
View const_lookup.rb
1 2 3 4 5
Integer.class
#=> Class
 
Integer(1)
#=> 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.