Class: HaproxyParser::Builders::ServerParser
- Inherits:
-
Object
- Object
- HaproxyParser::Builders::ServerParser
- Defined in:
- lib/haproxy_parser/builders/server_parser.rb
Instance Attribute Summary collapse
-
#backend_name ⇒ Object
readonly
Returns the value of attribute backend_name.
-
#line ⇒ Object
readonly
Returns the value of attribute line.
Instance Method Summary collapse
-
#initialize(line:, backend_name:) ⇒ ServerParser
constructor
A new instance of ServerParser.
- #ipaddress ⇒ Object
- #name ⇒ Object
- #port ⇒ Object
Constructor Details
#initialize(line:, backend_name:) ⇒ ServerParser
Returns a new instance of ServerParser.
8 9 10 11 |
# File 'lib/haproxy_parser/builders/server_parser.rb', line 8 def initialize(line:, backend_name:) @line = line @backend_name = backend_name end |
Instance Attribute Details
#backend_name ⇒ Object (readonly)
Returns the value of attribute backend_name.
7 8 9 |
# File 'lib/haproxy_parser/builders/server_parser.rb', line 7 def backend_name @backend_name end |
#line ⇒ Object (readonly)
Returns the value of attribute line.
7 8 9 |
# File 'lib/haproxy_parser/builders/server_parser.rb', line 7 def line @line end |
Instance Method Details
#ipaddress ⇒ Object
17 18 19 |
# File 'lib/haproxy_parser/builders/server_parser.rb', line 17 def ipaddress @ipaddress ||= line[1].split(":")[0] end |
#name ⇒ Object
13 14 15 |
# File 'lib/haproxy_parser/builders/server_parser.rb', line 13 def name @name ||= line[0] end |
#port ⇒ Object
21 22 23 |
# File 'lib/haproxy_parser/builders/server_parser.rb', line 21 def port @port ||= line[1].split(":")[1] end |