Skip to content

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
class Foo
def bar(*args)
attribute(:bar, *args)
end
def attribute(name)
puts name
end
end
foo = Foo.new
begin
foo.bar(100)
rescue => e
puts e.class.name
end
foo.bar # legit
5.times do
foo.bar(100)
end
puts 'No errors??? WTF???'
@byroot
Owner

ruby >= 2.0 output:

ArgumentError
bar
bar
bar
bar
bar
bar
No errors??? WTF???

ruby 1.8.7 (anything < 2.0) output:

ArgumentError
bar
(eval):3:in `attribute': wrong number of arguments (2 for 1) (ArgumentError)
    from (eval):3:in `bar'
    from foo.rb:28
    from foo.rb:27:in `times'
    from foo.rb:27
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.