class RhaproxyDefaults

A “defaults” section sets default parameters for all other sections following its declaration. Those default parameters are reset by the next “defaults” section. See below for the list of parameters which can be set in a “defaults” section. The name is optional but its use is encouraged for better readability.

Public Class Methods

new() click to toggle source

Returns a new RhaproxyDefaults Object

# File lib/rhaproxy/defaults.rb, line 77
def initialize()
  @conf ||= []
  @proxy_type = "defaults"
  @conf.push("  " + "#{@proxy_type} " + "\n")
  @name_index = @conf.index("  " + "#{@proxy_type} " + "\n")
end

Public Instance Methods

name(value = nil) click to toggle source

name <name>

The defaults name is encouraged for better readability.

NOTE: This will clear the existing values in the array.
# File lib/rhaproxy/defaults.rb, line 90
def name(value = nil)
  @conf.replace( [] )
  @conf.push("  " + "#{@proxy_type} " + value.to_s + "\n")
  @name_index = @conf.index("  " + "#{@proxy_type} " + value.to_s + "\n")
end