code_junkie

Ruby - equivalent of Python __str__() method?

Nov 11th, 2011
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.16 KB | None | 0 0
  1. irb(main):001:0> puts "array is: #{[1,2,3].inspect}"
  2. array is: [1, 2, 3]
  3. => nil
  4. irb(main):002:0> puts "array is: #{[1,2,3]}"
  5. array is: 123
  6. => nil
  7. irb(main):003:0>
Add Comment
Please, Sign In to add comment