Sha256: ad1255e9cfb0ae244eccb750f69a263ed553263f20a87997e521ebce6608eca4
Contents?: true
Size: 670 Bytes
Versions: 6
Compression:
Stored size: 670 Bytes
Contents
require_relative 'entity' module Services # This is a service member usually something that # would be sitting behind some VIP class Member < Services::Entity attr_accessor :ip, :port, :proto, :service, :weight 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 private def validate unless name && @service fail ARgumentError, "#{self.class} requires name and service argument" end end end end
Version data entries
6 entries across 6 versions & 1 rubygems