
エントリーの編集

エントリーの編集は全ユーザーに共通の機能です。
必ずガイドラインを一読の上ご利用ください。
記事へのコメント0件
- 注目コメント
- 新着コメント
このエントリーにコメントしてみましょう。
注目コメント算出アルゴリズムの一部にLINEヤフー株式会社の「建設的コメント順位付けモデルAPI」を使用しています

- バナー広告なし
- ミュート機能あり
- ダークモード搭載
関連記事
progate food.rb - Qiita
require "./menu" class Food < Menu attr_accessor :calorie def initialize(name:, price:, calorie:)... require "./menu" class Food < Menu attr_accessor :calorie def initialize(name:, price:, calorie:) super(name: name, price: price) self.calorie = calorie end def info return "#{self.name} #{self.price}円 (#{self.calorie}kcal)" end def calorie_info return "#{self.name}は#{self.calorie}kcalです" end end