Class: Nginxtra::Config::Indentation
- Inherits:
-
Object
- Object
- Nginxtra::Config::Indentation
- Defined in:
- lib/nginxtra/config.rb
Instance Attribute Summary collapse
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Instance Method Summary collapse
- #decrement ⇒ Object
- #done? ⇒ Boolean
- #increment ⇒ Object
- #indent_size ⇒ Object
-
#initialize(options = {}) ⇒ Indentation
constructor
A new instance of Indentation.
- #to_s ⇒ Object
Constructor Details
#initialize(options = {}) ⇒ Indentation
Returns a new instance of Indentation.
638 639 640 641 |
# File 'lib/nginxtra/config.rb', line 638 def initialize( = {}) @value = 0 = end |
Instance Attribute Details
#value ⇒ Object (readonly)
Returns the value of attribute value.
636 637 638 |
# File 'lib/nginxtra/config.rb', line 636 def value @value end |
Instance Method Details
#decrement ⇒ Object
651 652 653 |
# File 'lib/nginxtra/config.rb', line 651 def decrement adjust(-1) end |
#done? ⇒ Boolean
647 648 649 |
# File 'lib/nginxtra/config.rb', line 647 def done? @value == 0 end |
#increment ⇒ Object
655 656 657 |
# File 'lib/nginxtra/config.rb', line 655 def increment adjust(1) end |
#indent_size ⇒ Object
643 644 645 |
# File 'lib/nginxtra/config.rb', line 643 def indent_size [:indent_size] || 2 end |
#to_s ⇒ Object
659 660 661 |
# File 'lib/nginxtra/config.rb', line 659 def to_s " " * indent_size * @value end |