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



27
28
29
30
31
# File 'lib/falcon/proxy_endpoint.rb', line 27

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

Instance Attribute Details

#endpointObject (readonly)

Returns the value of attribute endpoint.



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

def endpoint
  @endpoint
end

Class Method Details

.unix(path, **options) ⇒ Object



67
68
69
# File 'lib/falcon/proxy_endpoint.rb', line 67

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

Instance Method Details

#authorityObject



47
48
49
# File 'lib/falcon/proxy_endpoint.rb', line 47

def authority
  @options[:authority]
end

#bind(&block) ⇒ Object



55
56
57
# File 'lib/falcon/proxy_endpoint.rb', line 55

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

#connect(&block) ⇒ Object



51
52
53
# File 'lib/falcon/proxy_endpoint.rb', line 51

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

#eachObject



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

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

#protocolObject



39
40
41
# File 'lib/falcon/proxy_endpoint.rb', line 39

def protocol
  @options[:protocol]
end

#schemeObject



43
44
45
# File 'lib/falcon/proxy_endpoint.rb', line 43

def scheme
  @options[:scheme]
end

#to_sObject



33
34
35
# File 'lib/falcon/proxy_endpoint.rb', line 33

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