Class: HaproxyParser::Config
- Inherits:
-
Object
- Object
- HaproxyParser::Config
- Defined in:
- lib/haproxy_parser/config.rb
Constant Summary collapse
- SECTIONS =
%w(global defaults frontend backend)
Instance Attribute Summary collapse
-
#path ⇒ Object
readonly
Returns the value of attribute path.
Instance Method Summary collapse
- #backends ⇒ Object
- #check_format! ⇒ Object
- #frontends ⇒ Object
- #global ⇒ Object
-
#initialize(path) ⇒ Config
constructor
A new instance of Config.
- #parse ⇒ Object
Constructor Details
#initialize(path) ⇒ Config
Returns a new instance of Config.
10 11 12 |
# File 'lib/haproxy_parser/config.rb', line 10 def initialize(path) @path = path end |
Instance Attribute Details
#path ⇒ Object (readonly)
Returns the value of attribute path.
9 10 11 |
# File 'lib/haproxy_parser/config.rb', line 9 def path @path end |
Instance Method Details
#backends ⇒ Object
34 35 36 |
# File 'lib/haproxy_parser/config.rb', line 34 def backends @backends ||= [] end |
#check_format! ⇒ Object
14 15 16 17 18 |
# File 'lib/haproxy_parser/config.rb', line 14 def check_format! HaproxyParser::FormatChecker.new( path ).run end |
#frontends ⇒ Object
30 31 32 |
# File 'lib/haproxy_parser/config.rb', line 30 def frontends @frontends ||= [] end |
#global ⇒ Object
26 27 28 |
# File 'lib/haproxy_parser/config.rb', line 26 def global @global ||= build_global end |
#parse ⇒ Object
20 21 22 23 24 |
# File 'lib/haproxy_parser/config.rb', line 20 def parse check_format! build self end |