サンプルコード
parent_class # encoding: Shift_JIS =begin rdoc = ParentClassクラス =end class ParentClass def method1(str) puts "親#{str}" end end
child_class
# encoding: Shift_JIS require_relative './parent_class' =begin rdoc = ChildClassクラス =end class ChildClass < ParentClass def method1(str) super puts "子#{str}" end end
main
# encoding: Shift_JIS require_relative './child_class' child = ChildClass.new child.method1 "Hello"
出力
親Hello 子Hello