Sha256: ed968f50ed2e14fc8541eeae69b2539859e6d26bfcc1c7e94139d3d278d9d360

Contents?: true

Size: 543 Bytes

Versions: 9

Compression:

Stored size: 543 Bytes

Contents

# Services::Endpoint
# The VIP of the service. This class describes where an endpoint lives
#
module Services
  require_relative 'entity'

  # endpoint describes a VIP ip
  class Endpoint < Services::Entity
    attr_accessor :ip, :port, :proto
    def initialize(name, args = {})
      @ip    = args[:ip] || ''
      @proto = args[:proto] || 'http'
      @port  = args[:port]  || 80
      @path  = "#{name}/endpoint"
      super
    end

    private

    def validate
      fail 'endpont requires a service name' unless name
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
jn_services-1.0.8 lib/services/endpoint.rb
jn_services-1.0.7 lib/services/endpoint.rb
jn_services-1.0.6 lib/services/endpoint.rb
jn_services-1.0.5 lib/services/endpoint.rb
jn_services-1.0.4 lib/services/endpoint.rb
jn_services-1.0.3 lib/services/endpoint.rb
jn_services-1.0.2 lib/services/endpoint.rb
jn_services-1.0.1 lib/services/endpoint.rb
jn_services-1.0.0 lib/services/endpoint.rb