Class: Falcon::ProxyEndpoint

Inherits:
Async::IO::Endpoint
  • Object
show all
Defined in:
lib/falcon/proxy_endpoint.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(endpoint, **options) ⇒ ProxyEndpoint

Returns a new instance of ProxyEndpoint.



25
26
27
28
29
# File 'lib/falcon/proxy_endpoint.rb', line 25

def initialize(endpoint, **options)
	super(**options)
	
	@endpoint = endpoint
end

Instance Attribute Details

#endpointObject (readonly)

Returns the value of attribute endpoint.



35
36
37
# File 'lib/falcon/proxy_endpoint.rb', line 35

def endpoint
  @endpoint
end

Class Method Details

.unix(path, **options) ⇒ Object



65
66
67
# File 'lib/falcon/proxy_endpoint.rb', line 65

def self.unix(path, **options)
	self.new(::Async::IO::Endpoint.unix(path), **options)
end

Instance Method Details

#authorityObject



45
46
47
# File 'lib/falcon/proxy_endpoint.rb', line 45

def authority
	@options[:authority]
end

#bind(&block) ⇒ Object



53
54
55
# File 'lib/falcon/proxy_endpoint.rb', line 53

def bind(&block)
	@endpoint.bind(&block)
end

#connect(&block) ⇒ Object



49
50
51
# File 'lib/falcon/proxy_endpoint.rb', line 49

def connect(&block)
	@endpoint.connect(&block)
end

#eachObject



57
58
59
60
61
62
63
# File 'lib/falcon/proxy_endpoint.rb', line 57

def each
	return to_enum unless block_given?
	
	@endpoint.each do |endpoint|
		yield self.class.new(endpoint, @options)
	end
end

#protocolObject



37
38
39
# File 'lib/falcon/proxy_endpoint.rb', line 37

def protocol
	@options[:protocol]
end

#schemeObject



41
42
43
# File 'lib/falcon/proxy_endpoint.rb', line 41

def scheme
	@options[:scheme]
end

#to_sObject



31
32
33
# File 'lib/falcon/proxy_endpoint.rb', line 31

def to_s
	"\#<#{self.class} endpoint=#{@endpoint}>"
end