Class: HaproxyParser::Builders::BindParser
- Inherits:
-
Object
- Object
- HaproxyParser::Builders::BindParser
- Defined in:
- lib/haproxy_parser/builders/bind_parser.rb
Instance Attribute Summary collapse
-
#line ⇒ Object
readonly
Returns the value of attribute line.
Instance Method Summary collapse
-
#initialize(line) ⇒ BindParser
constructor
A new instance of BindParser.
- #ipaddress ⇒ Object
- #port ⇒ Object
- #ssl ⇒ Object
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
#line ⇒ Object (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
#ipaddress ⇒ Object
13 14 15 |
# File 'lib/haproxy_parser/builders/bind_parser.rb', line 13 def ipaddress @address ||= line[0].split(":")[0] end |
#port ⇒ Object
17 18 19 |
# File 'lib/haproxy_parser/builders/bind_parser.rb', line 17 def port @port ||= line[0].split(":")[1] end |
#ssl ⇒ Object
21 22 23 |
# File 'lib/haproxy_parser/builders/bind_parser.rb', line 21 def ssl @ssl ||= line.include?("ssl") end |