Class: HaproxyParser::Builders::Frontend

Inherits:
Base
  • Object
show all
Defined in:
lib/haproxy_parser/builders/frontend.rb

Instance Attribute Summary collapse

Attributes inherited from Base

#default, #section

Instance Method Summary collapse

Methods inherited from Base

#attributes, #name

Constructor Details

#initialize(section:, default: nil, backend: nil) ⇒ Frontend

Returns a new instance of Frontend.



7
8
9
10
# File 'lib/haproxy_parser/builders/frontend.rb', line 7

def initialize(section:, default: nil, backend: nil)
  super(section: section, default: default)
  @backend = backend
end

Instance Attribute Details

#backendObject

Returns the value of attribute backend.



6
7
8
# File 'lib/haproxy_parser/builders/frontend.rb', line 6

def backend
  @backend
end

Instance Method Details

#backend_nameObject



12
13
14
15
16
17
18
# File 'lib/haproxy_parser/builders/frontend.rb', line 12

def backend_name
  @backend_name ||= if dig_data("use_backend")
    dig_data("use_backend")
  else
    dig_data("default_backend")
  end
end

#ipaddressObject



20
21
22
# File 'lib/haproxy_parser/builders/frontend.rb', line 20

def ipaddress
  @ipaddress ||= bind_parser.ipaddress
end

#modeObject



32
33
34
# File 'lib/haproxy_parser/builders/frontend.rb', line 32

def mode
  @mode ||= dig_data("mode")
end

#portObject



24
25
26
# File 'lib/haproxy_parser/builders/frontend.rb', line 24

def port
  @port ||= bind_parser.port
end

#sslObject



28
29
30
# File 'lib/haproxy_parser/builders/frontend.rb', line 28

def ssl
  @ssl ||= bind_parser.ssl
end