Class: HaproxyParser::LineParser
- Inherits:
-
Object
- Object
- HaproxyParser::LineParser
- Defined in:
- lib/haproxy_parser/line_parser.rb
Instance Attribute Summary collapse
-
#list ⇒ Object
readonly
Returns the value of attribute list.
Instance Method Summary collapse
-
#initialize(list) ⇒ LineParser
constructor
A new instance of LineParser.
- #value(attr) ⇒ Object
Constructor Details
#initialize(list) ⇒ LineParser
Returns a new instance of LineParser.
4 5 6 |
# File 'lib/haproxy_parser/line_parser.rb', line 4 def initialize(list) @list = list end |
Instance Attribute Details
#list ⇒ Object (readonly)
Returns the value of attribute list.
3 4 5 |
# File 'lib/haproxy_parser/line_parser.rb', line 3 def list @list end |
Instance Method Details
#value(attr) ⇒ Object
8 9 10 11 12 13 14 15 |
# File 'lib/haproxy_parser/line_parser.rb', line 8 def value(attr) nil.tap do |ret| list.each_with_index do |v, i| ret = list[i+1] if attr == v end break ret end end |