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.
25 26 27 28 29 |
# File 'lib/puppet/pops/types/string_converter.rb', line 25 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.
20 21 22 |
# File 'lib/puppet/pops/types/string_converter.rb', line 20 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.
21 22 23 |
# File 'lib/puppet/pops/types/string_converter.rb', line 21 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.
19 20 21 |
# File 'lib/puppet/pops/types/string_converter.rb', line 19 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.
43 44 45 |
# File 'lib/puppet/pops/types/string_converter.rb', line 43 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.
39 40 41 |
# File 'lib/puppet/pops/types/string_converter.rb', line 39 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.
35 36 37 |
# File 'lib/puppet/pops/types/string_converter.rb', line 35 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.
47 48 49 |
# File 'lib/puppet/pops/types/string_converter.rb', line 47 def padding return ' ' * 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.
31 32 33 |
# File 'lib/puppet/pops/types/string_converter.rb', line 31 def subsequent first? ? self.class.new(level, false, @is_indenting) : self end |