class Object
Public Instance Methods
display(new_line = true)
click to toggle source
Outputs the object and also returns it. Will use puts
if new_line
is true
and print
otherwise.
@example
"foo".display foo #=> "foo" "foo".display(false) foo#=> "foo"
# File lib/shenanigans/object/display.rb, line 12 def display(new_line = true) m = new_line ? :puts : :print tap { |o| send(m, o) } end
Also aliased as: d