5 ms·
tl;dr -> Ruby allows you to bypass private/protected by using Object#send class Object private def name puts "Name called" end
by epochwolf 17y ago
tl;dr -> Ruby allows you to bypass private/protected by using Object#send
class Object
private
def name
puts "Name called"
end
end
o = Object.new
o = o.send :name # outputs "Name called"
And therefore you can easily test private methods.