Class: Async::HTTP::Protocol::Configured
- Inherits:
-
Object
- Object
- Async::HTTP::Protocol::Configured
- Defined in:
- lib/async/http/protocol/configurable.rb
Overview
A protocol wrapper that forwards pre-configured options to client and server creation.
Instance Attribute Summary collapse
-
#options ⇒ Object
readonly
Returns the value of attribute options.
-
#protocol ⇒ Object
readonly
Returns the value of attribute protocol.
- #The underlying protocol.(underlyingprotocol.) ⇒ Object readonly
Instance Method Summary collapse
-
#client(peer, **options) ⇒ Object
Create a client connection using the configured protocol options.
-
#initialize(protocol, **options) ⇒ Configured
constructor
Initialize with a protocol and options.
- #names ⇒ Object
-
#server(peer, **options) ⇒ Object
Create a server connection using the configured protocol options.
- #The options to pass to the protocol.=(optionstopasstotheprotocol. = (value)) ⇒ Object
Constructor Details
#initialize(protocol, **options) ⇒ Configured
Initialize with a protocol and options.
14 15 16 17 |
# File 'lib/async/http/protocol/configurable.rb', line 14 def initialize(protocol, **) @protocol = protocol @options = end |
Instance Attribute Details
#options ⇒ Object (readonly)
Returns the value of attribute options.
23 24 25 |
# File 'lib/async/http/protocol/configurable.rb', line 23 def @options end |
#protocol ⇒ Object (readonly)
Returns the value of attribute protocol.
20 21 22 |
# File 'lib/async/http/protocol/configurable.rb', line 20 def protocol @protocol end |
#The underlying protocol.(underlyingprotocol.) ⇒ Object (readonly)
20 |
# File 'lib/async/http/protocol/configurable.rb', line 20 attr :protocol |
Instance Method Details
#client(peer, **options) ⇒ Object
Create a client connection using the configured protocol options.
28 29 30 31 |
# File 'lib/async/http/protocol/configurable.rb', line 28 def client(peer, **) = @options.merge() @protocol.client(peer, **) end |
#names ⇒ Object
42 43 44 |
# File 'lib/async/http/protocol/configurable.rb', line 42 def names @protocol.names end |
#server(peer, **options) ⇒ Object
Create a server connection using the configured protocol options.
36 37 38 39 |
# File 'lib/async/http/protocol/configurable.rb', line 36 def server(peer, **) = @options.merge() @protocol.server(peer, **) end |
#The options to pass to the protocol.=(optionstopasstotheprotocol. = (value)) ⇒ Object
23 |
# File 'lib/async/http/protocol/configurable.rb', line 23 attr :options |