Class: Puppet::Pops::Types::StringConverter::Indentation Private
- Defined in:
- lib/puppet/pops/types/string_converter.rb
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Instance Attribute Summary collapse
- #first ⇒ Object (also: #first?) readonly private
- #is_indenting ⇒ Object (also: #is_indenting?) readonly private
- #level ⇒ Object readonly private
Instance Method Summary collapse
- #breaks? ⇒ Boolean private
- #increase(indenting_flag = false) ⇒ Object private
- #indenting(indenting_flag) ⇒ Object private
-
#initialize(level, first, is_indenting) ⇒ Indentation
constructor
private
A new instance of Indentation.
- #padding ⇒ Object private
- #subsequent ⇒ Object private
Constructor Details
#initialize(level, first, is_indenting) ⇒ Indentation
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of Indentation.
27 28 29 30 31 |
# File 'lib/puppet/pops/types/string_converter.rb', line 27 def initialize(level, first, is_indenting) @level = level @first = first @is_indenting = is_indenting end |
Instance Attribute Details
#first ⇒ Object (readonly) Also known as: first?
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
22 23 24 |
# File 'lib/puppet/pops/types/string_converter.rb', line 22 def first @first end |
#is_indenting ⇒ Object (readonly) Also known as: is_indenting?
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
23 24 25 |
# File 'lib/puppet/pops/types/string_converter.rb', line 23 def is_indenting @is_indenting end |
#level ⇒ Object (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
21 22 23 |
# File 'lib/puppet/pops/types/string_converter.rb', line 21 def level @level end |
Instance Method Details
#breaks? ⇒ Boolean
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
45 46 47 |
# File 'lib/puppet/pops/types/string_converter.rb', line 45 def breaks? is_indenting? && level > 0 && !first? end |
#increase(indenting_flag = false) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
41 42 43 |
# File 'lib/puppet/pops/types/string_converter.rb', line 41 def increase(indenting_flag = false) self.class.new(level + 1, true, indenting_flag) end |
#indenting(indenting_flag) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
37 38 39 |
# File 'lib/puppet/pops/types/string_converter.rb', line 37 def indenting(indenting_flag) self.class.new(level, first?, indenting_flag) end |
#padding ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
49 50 51 |
# File 'lib/puppet/pops/types/string_converter.rb', line 49 def padding ' ' * 2 * level end |
#subsequent ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
33 34 35 |
# File 'lib/puppet/pops/types/string_converter.rb', line 33 def subsequent first? ? self.class.new(level, false, @is_indenting) : self end |