Skip to content

Instantly share code, notes, and snippets.

@Arakaki
Created September 5, 2013 13:43
Show Gist options
  • Save Arakaki/6450279 to your computer and use it in GitHub Desktop.
Save Arakaki/6450279 to your computer and use it in GitHub Desktop.
継承
class Parent
def hello
puts 'Hello,Parent class!'
end
end
class Child < Parent
def hi
puts 'Hello, Child class!'
end
end
child = Child.new
puts child.hello
puts child.hi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment