Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: 6affa26d97
Fetching contributors…

Cannot retrieve contributors at this time

28 lines (21 sloc) 0.55 kb
# Debug Printing Method
# The Ruby equivalent to the VisualWorks displayString/printString
# split would be #to_s/#inspect.
# Association example:
class Association
attr_accessor :key, :value
def print_on(io)
io.write key
io.write '->'
io.write value
end
end
# For better or for worse, though, telling objects how to dump
# themselves to a stream isn't really Rubyish. We tend to tell objects
# how to stringify themselves instead.
class Association
attr_accessor :key, :value
def inspect
"#{key}->#{value}"
end
end
Jump to Line
Something went wrong with that request. Please try again.