Why does respond_to? need symbols as arguments in Ruby? -
why method accept symbols , not strings arguments?
x = 10 x.respond_to?(next) pushing string above throw (ruby):1: void value expression.
it accept strings:
x = 10 x.respond_to?('next') # => true your problem didn't pass string, next keyword.
Comments
Post a Comment