Class: ProxyMgr::Haproxy::Server

Inherits:
Object
  • Object
show all
Defined in:
lib/proxymgr/haproxy/server.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#statsObject (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

#backendObject



11
12
13
# File 'lib/proxymgr/haproxy/server.rb', line 11

def backend
  @stats['pxname']
end

#disabled?Boolean

Returns:

  • (Boolean)


19
20
21
# File 'lib/proxymgr/haproxy/server.rb', line 19

def disabled?
  @stats['status'] == 'MAINT'
end

#nameObject



15
16
17
# File 'lib/proxymgr/haproxy/server.rb', line 15

def name
  @stats['svname']
end