Ruby is an open-source, object-oriented programming language. It was created in the mid-1990s by Yukihiro Matsumoto in Japan. Ruby is used for building web applications, websites, and other software.
Example:
# Create a new class called “Person”
class Person
# Define an initialize method to set the name
def initialize(name)
@name = name
end
# Define a method to greet the person
def greet
puts “Hello, my name is #{@name}!”
end
end
# Create a new person object
person = Person.new(“John”)
# Call the greet method
person.greet