Class: 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.



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

def initialize(indent)
  @indent = indent
end

Class Method Details

.add_line(indent, input, result) ⇒ Object



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

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

.indent(indent, string) ⇒ Object



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

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