Class: Services::Member

Inherits:
Entity
  • Object
show all
Defined in:
lib/services/member.rb

Overview

This is a service member usually something that would be sitting behind some VIP

Instance Attribute Summary collapse

Attributes inherited from Entity

#name, #path

Instance Method Summary collapse

Methods inherited from Entity

#load, #store, #to_hash

Constructor Details

#initialize(name, args = {}) ⇒ Member

Returns a new instance of Member.



8
9
10
11
12
13
14
15
16
# File 'lib/services/member.rb', line 8

def initialize(name, args = {})
  @ip = args[:ip] || ''
  @proto = args[:proto] || 'http'
  @port  = args[:port]  || 80
  @weight = args[:weight] || 20
  @service = args[:service]
  @path = "#{service}/members/#{name}"
  super
end

Instance Attribute Details

#ipObject

Returns the value of attribute ip.



7
8
9
# File 'lib/services/member.rb', line 7

def ip
  @ip
end

#portObject

Returns the value of attribute port.



7
8
9
# File 'lib/services/member.rb', line 7

def port
  @port
end

#protoObject

Returns the value of attribute proto.



7
8
9
# File 'lib/services/member.rb', line 7

def proto
  @proto
end

#serviceObject

Returns the value of attribute service.



7
8
9
# File 'lib/services/member.rb', line 7

def service
  @service
end

#weightObject

Returns the value of attribute weight.



7
8
9
# File 'lib/services/member.rb', line 7

def weight
  @weight
end