Discussion:
ClassName( ) e.g. Integer( 3.5 )
Chris Freyberg
2015-07-08 23:34:42 UTC
Permalink
I found a use of this syntax in some Ruby code, but could not find
anything in ruby-doc about by Google search.

Is ClassName() syntactic sugar for ClassName.new() or is it something else?
Has it been deprecated or discouraged ( or some other reason why it is
difficult to find in ruby-doc )?

Ta
Evan Farrar
2015-07-08 23:40:42 UTC
Permalink
Integer( ) is a helper method defined on Kernel, not a special syntax.
I found a use of this syntax in some Ruby code, but could not find anything in ruby-doc about by Google search.
Is ClassName() syntactic sugar for ClassName.new() or is it something else?
Has it been deprecated or discouraged ( or some other reason why it is difficult to find in ruby-doc )?
Ta
Loading...