Last active
April 29, 2020 04:23
-
-
Save drinkmorewaters/882f50268a22c0936a07c0d735f77084 to your computer and use it in GitHub Desktop.
Record Macro for creating Struct in Crystal
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
record Cars, type : String, price : Int64, condition : String, location : String, color : String do | |
def car_return | |
puts "Johns car is in #{condition} condition, although, the price is cheap at only $#{price}" | |
end | |
end | |
Johns_car = Cars.new "Ford", 10000, "Fair", "New York", "Red" | |
Johns_car.car_return |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment