Class: Pindo::Plistbuddyexecutable::Plistbuddyindenter
- Inherits:
-
Array
- Object
- Array
- Pindo::Plistbuddyexecutable::Plistbuddyindenter
- Defined in:
- lib/pindo/base/plistbuddyexecutable.rb
Overview
Helper class that allows to write to an IO instance taking into account the UI indentation level.
Instance Attribute Summary collapse
-
#indent ⇒ Fixnum
readonly
The indentation level of the UI.
-
#io ⇒ IO
readonly
The IO to which the output should be printed.
Instance Method Summary collapse
-
#<<(value) ⇒ void
Stores a portion of the output and prints it to the IO instance.
-
#initialize(io = nil) ⇒ Plistbuddyindenter
constructor
Init a new Indenter.
Constructor Details
#initialize(io = nil) ⇒ Plistbuddyindenter
Init a new Indenter
103 104 105 106 |
# File 'lib/pindo/base/plistbuddyexecutable.rb', line 103 def initialize(io = nil) @io = io @indent = ' ' end |
Instance Attribute Details
#indent ⇒ Fixnum (readonly)
Returns The indentation level of the UI.
93 94 95 |
# File 'lib/pindo/base/plistbuddyexecutable.rb', line 93 def indent @indent end |
#io ⇒ IO (readonly)
Returns the IO to which the output should be printed.
97 98 99 |
# File 'lib/pindo/base/plistbuddyexecutable.rb', line 97 def io @io end |
Instance Method Details
#<<(value) ⇒ void
This method returns an undefined value.
Stores a portion of the output and prints it to the IO instance.
115 116 117 118 |
# File 'lib/pindo/base/plistbuddyexecutable.rb', line 115 def <<(value) super io << "#{indent}#{value}" if io end |