Skip to content

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
#!/usr/bin/env ruby
class Name
def hello
puts "Hello!"
end
def say_bye
bye()
end
private
def bye
puts "Good bye"
end
end
# x = Name.new
# x.hello # works fine
# x.say_bye # works fine
# x.bye # can't call this one, only a non-private method within the same class can call it, better say 'use it'.
class Surname < Name
def test
bye()
end
end
y = Surname.new
y.test # works
y.hello # works
y.bye # doesn't work.
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.