Class: CfFactory::CfGenerator

Inherits:
Object
  • Object
show all
Defined in:
lib/cf_factory/base/cf_generator.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(indent) ⇒ CfGenerator

Returns a new instance of CfGenerator.



3
4
5
# File 'lib/cf_factory/base/cf_generator.rb', line 3

def initialize(indent)
  @indent = indent
end

Class Method Details

.add_line(indent, input, result) ⇒ Object



7
8
9
# File 'lib/cf_factory/base/cf_generator.rb', line 7

def self.add_line(indent, input, result)
  result += "\n#{self.indent(indent, input)}"
end

.indent(indent, string) ⇒ Object



11
12
13
14
15
16
17
# File 'lib/cf_factory/base/cf_generator.rb', line 11

def self.indent(indent, string)
  result = ""
  string.each_line() {|s|
    result += "#{" "*indent}#{s}"      
  }
  result
end