Created
June 12, 2013 09:38
-
-
Save LFDM/5764031 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class A | |
def initialize | |
@a = "Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt" | |
@b = "ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris" | |
end | |
def to_s | |
@a[0] + @b[0] | |
end | |
end | |
arr = [] | |
5.times { arr << A.new } | |
puts " --- to_s --- " | |
puts arr.to_s | |
puts | |
puts " --- inspect --- " | |
puts arr.inspect | |
puts | |
puts " --- puts --- " | |
puts arr | |
puts | |
puts " --- String Interpolation --- " | |
puts "#{arr}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment