Class: Tomahawk::Generators::HTTPd

Inherits:
Base
  • Object
show all
Defined in:
lib/tomahawk/generators/httpd.rb

Instance Method Summary collapse

Methods included from Tomahawk::Generators

#directive_group_name, #generate_directive

Constructor Details

#initialize(httpd) ⇒ HTTPd

Returns a new instance of HTTPd.



5
6
7
# File 'lib/tomahawk/generators/httpd.rb', line 5

def initialize(httpd)
  @httpd = httpd
end

Instance Method Details

#to_strObject Also known as: to_s



9
10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/tomahawk/generators/httpd.rb', line 9

def to_str
  config = ''

  @httpd.directives.each do |directive, value|
    config += generate_directive(directive, value) 
  end

  @httpd.groups.each do |group|
    config += group.to_s
  end

  config
end