Class: Prissy::Printer
- Inherits:
-
Object
- Object
- Prissy::Printer
- Defined in:
- lib/prissy/printer.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#options ⇒ Object
readonly
Returns the value of attribute options.
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ Printer
constructor
A new instance of Printer.
- #print(object) ⇒ Object
Constructor Details
#initialize(options = {}) ⇒ Printer
Returns a new instance of Printer.
5 6 7 8 9 10 |
# File 'lib/prissy/printer.rb', line 5 def initialize( = {}) @txt = "" @indent = 0 @options = [:max_width] ||= 80 end |
Instance Attribute Details
#options ⇒ Object (readonly)
Returns the value of attribute options.
3 4 5 |
# File 'lib/prissy/printer.rb', line 3 def @options end |
Instance Method Details
#print(object) ⇒ Object
12 13 14 15 |
# File 'lib/prissy/printer.rb', line 12 def print(object) print_object(object) @txt << "\n" end |