DEV Community

Adolfo Nava
Adolfo Nava

Posted on

Today I learned about basic Ruby syntax

# Commenting goes like this for single-line statements
=begin
This is for when you want comments to go more than one line 
without having to keep putting a # before anything intended for 
comments
=end
=begin 
[name] variables  example below name is now a variable that 
can be called multiple times and can be changed at any point by 
the developer using methods or reassigning the variable based on 
whatever the developer's intentions are
=end
name = "Adolfo"
#    ^ means to assign the variable to whatever you want it to be whether that would be a number or a string by putting ""
number = "123456"
pp number.to_i

require "date"

saved_date = Date.new(2024,12,25)
pp saved_date
# method calling for strings or int objects [name].{method name}(arguments for method)
Enter fullscreen mode Exit fullscreen mode

Top comments (0)