Mega Code Archive

 
Categories / Ruby / String
 

Convert an object to a string with to_s

Ruby calls the to_s method from the class of the object, not the String class parentheses are optional. (256.0).class # => Float (256.0).to_s # => "256.0"