2019-07-07から1日間の記事一覧
はじめに 継承とrequireを用いてファイル別にclassを記述する方法を勉強したので備忘録をとっておく。 Rubyの継承 class Parent def hello puts "Hello" end end class Child < Parent def hi puts "Hi" end end child = Child.new child.hello のようにclas…
はじめに 継承とrequireを用いてファイル別にclassを記述する方法を勉強したので備忘録をとっておく。 Rubyの継承 class Parent def hello puts "Hello" end end class Child < Parent def hi puts "Hi" end end child = Child.new child.hello のようにclas…