J
John Winters
Can anyone explain this for me?
john@liberty:~/Work/Coding/Xronos/test$ cat testpadding.rb
class Padding
def inspect
'.' * 4
end
end
john@liberty:~/Work/Coding/Xronos/test$ irb -r testpadding.rb
The inspect method seems to return a string consisting of 4 full stops,
and yet irb displays six. Why? If inspect returns a string of any
other letter it seems to work as expected.
John
john@liberty:~/Work/Coding/Xronos/test$ cat testpadding.rb
class Padding
def inspect
'.' * 4
end
end
john@liberty:~/Work/Coding/Xronos/test$ irb -r testpadding.rb
The inspect method seems to return a string consisting of 4 full stops,
and yet irb displays six. Why? If inspect returns a string of any
other letter it seems to work as expected.
John