Ruby OOP auto

Run Settings
LanguageRuby
Language Version
Run Command
class Auto attr_accessor :znacka, :model, :rok_vyroby # Konstruktor def initialize(znacka, model, rok_vyroby) @znacka = znacka @model = model @rok_vyroby = rok_vyroby end def zobraz_info puts "Znacka: #{@znacka}" puts "Model: #{@model}" puts "Rok vyroby: #{@rok_vyroby}" end end # Vytvoreni objektu auto moje_auto = Auto.new("Toyota", "Corolla", 2020) moje_auto.zobraz_info
Editor Settings
Theme
Key bindings
Full width
Lines