Skip to content
Programming101
Programming101

Learn everything about programming

  • Home
  • CS Subjects
    • IoT – Internet of Things
    • Digital Communication
    • Human Values
  • Programming Tutorials
    • C Programming
    • Data structures and Algorithms
  • HackerRank Solutions
    • HackerRank Algorithms Solutions
    • HackerRank C problems solutions
    • HackerRank C++ problems solutions
    • HackerRank Java problems solutions
    • HackerRank Python problems solutions
Programming101
Programming101

Learn everything about programming

HackerRank Ruby Tutorial – Everything is an object problem solution

YASH PAL, 31 July 2024

In this HackerRank Ruby Tutorial – Everything is an object problem solution in ruby everything is treated as an object. every piece of code has it’s own properties and actions.

 Everything is an object in Ruby. For instance, if you type

print self

in the code editor, Ruby treats self as the object to which it is currently referred to.

Give it a try!

hackerrank ruby tutorial - everything is an object problem solution

Problem solution.

# Enter your code here. Read input from STDIN. Print output to STDOUT
print self
In ruby, everything that appears is called an object. that’s why ruby is a pure object-oriented programming language. every single value like string, number, class is an object in ruby.
In ruby, an object is called a blueprint for instance, so basically an object is created from a class and we declare objects of a class using the new keyword.
object_name = class_name.new
coding problems ruby

Post navigation

Previous post
Next post
  • HackerRank Separate the Numbers solution
  • How AI Is Revolutionizing Personalized Learning in Schools
  • GTA 5 is the Game of the Year for 2024 and 2025
  • Hackerrank Day 5 loops 30 days of code solution
  • Hackerrank Day 6 Lets Review 30 days of code solution
©2025 Programming101 | WordPress Theme by SuperbThemes