Class: PrettyPrint::SingleLine

Inherits:
Object
  • Object
show all
Defined in:
lib/jinx/helpers/pretty_print.rb

Overview

The standard prettyprint gem SingleLine is adjusted to add an output accessor and an optional output argument to #initialize.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(output = '', maxwidth = nil, newline = nil) ⇒ SingleLine

Overrides the standard SingleLine initializer to supply an output parameter default.



19
20
21
# File 'lib/jinx/helpers/pretty_print.rb', line 19

def initialize(output='', maxwidth=nil, newline=nil)
  base__initialize(output, maxwidth, newline)
end

Instance Attribute Details

#outputString (readonly)

Returns the print target.

Returns:

  • (String)

    the print target



13
14
15
# File 'lib/jinx/helpers/pretty_print.rb', line 13

def output
  @output
end

Instance Method Details

#base__initializeObject (private)



15
# File 'lib/jinx/helpers/pretty_print.rb', line 15

alias :base__initialize :initialize