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)

Eliminate Context Switching and Maximize Productivity

Pieces.app

Pieces Copilot is your personalized workflow assistant, working alongside your favorite apps. Ask questions about entire repositories, generate contextualized code, save and reuse useful snippets, and streamline your development process.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay