Class: Object
- Inherits:
- BasicObject
- Defined in:
- lib/shenanigans/object/display.rb
Instance Method Summary collapse
-
#display(new_line = true) ⇒ Object
(also: #d)
Outputs the object and also returns it.
Instance Method Details
#display(new_line = true) ⇒ Object Also known as: d
Outputs the object and also returns it. Will use puts
if new_line
is true
and print
otherwise.
12 13 14 15 |
# File 'lib/shenanigans/object/display.rb', line 12 def display(new_line = true) m = new_line ? :puts : :print tap { |o| send(m, o) } end |