Class: HaproxyParser::Builders::BindParser

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(line) ⇒ BindParser

Returns a new instance of BindParser.



5
6
7
8
9
10
11
# File 'lib/haproxy_parser/builders/bind_parser.rb', line 5

def initialize(line)
  @line = if line.is_a?(Array)
            line
          else
            [] << line
          end
end

Instance Attribute Details

#lineObject (readonly)

Returns the value of attribute line.



4
5
6
# File 'lib/haproxy_parser/builders/bind_parser.rb', line 4

def line
  @line
end

Instance Method Details

#ipaddressObject



13
14
15
# File 'lib/haproxy_parser/builders/bind_parser.rb', line 13

def ipaddress
  @address ||= line[0].split(":")[0]
end

#portObject



17
18
19
# File 'lib/haproxy_parser/builders/bind_parser.rb', line 17

def port
  @port ||= line[0].split(":")[1]
end

#sslObject



21
22
23
# File 'lib/haproxy_parser/builders/bind_parser.rb', line 21

def ssl
  @ssl ||= line.include?("ssl")
end