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)

Jetbrains image

Build Secure, Ship Fast

Discover best practices to secure CI/CD without slowing down your pipeline.

Read more

👋 Kindness is contagious

Explore a trove of insights in this engaging article, celebrated within our welcoming DEV Community. Developers from every background are invited to join and enhance our shared wisdom.

A genuine "thank you" can truly uplift someone’s day. Feel free to express your gratitude in the comments below!

On DEV, our collective exchange of knowledge lightens the road ahead and strengthens our community bonds. Found something valuable here? A small thank you to the author can make a big difference.

Okay