Class: ProxyMgr::Haproxy::Server
- Inherits:
-
Object
- Object
- ProxyMgr::Haproxy::Server
- Defined in:
- lib/proxymgr/haproxy/server.rb
Instance Attribute Summary collapse
-
#stats ⇒ Object
readonly
Returns the value of attribute stats.
Instance Method Summary collapse
- #backend ⇒ Object
- #disabled? ⇒ Boolean
-
#initialize(haproxy, stats) ⇒ Server
constructor
A new instance of Server.
- #name ⇒ Object
Constructor Details
#initialize(haproxy, stats) ⇒ Server
Returns a new instance of Server.
6 7 8 9 |
# File 'lib/proxymgr/haproxy/server.rb', line 6 def initialize(haproxy, stats) @haproxy = haproxy @stats = stats end |
Instance Attribute Details
#stats ⇒ Object (readonly)
Returns the value of attribute stats.
4 5 6 |
# File 'lib/proxymgr/haproxy/server.rb', line 4 def stats @stats end |
Instance Method Details
#backend ⇒ Object
11 12 13 |
# File 'lib/proxymgr/haproxy/server.rb', line 11 def backend @stats['pxname'] end |
#disabled? ⇒ Boolean
19 20 21 |
# File 'lib/proxymgr/haproxy/server.rb', line 19 def disabled? @stats['status'] == 'MAINT' end |
#name ⇒ Object
15 16 17 |
# File 'lib/proxymgr/haproxy/server.rb', line 15 def name @stats['svname'] end |