Class: Consul::Async::JSONConfiguration
- Inherits:
-
Object
- Object
- Consul::Async::JSONConfiguration
- Defined in:
- lib/consul/async/json_endpoint.rb
Overview
Configuration to apply to JSONEndpoints
Instance Attribute Summary collapse
-
#debug ⇒ Object
readonly
Returns the value of attribute debug.
-
#enable_gzip_compression ⇒ Object
readonly
Returns the value of attribute enable_gzip_compression.
-
#headers ⇒ Object
readonly
Returns the value of attribute headers.
-
#json_body ⇒ Object
readonly
Returns the value of attribute json_body.
-
#min_duration ⇒ Object
readonly
Returns the value of attribute min_duration.
-
#request_method ⇒ Object
readonly
Returns the value of attribute request_method.
-
#retry_duration ⇒ Object
readonly
Returns the value of attribute retry_duration.
-
#retry_on_non_diff ⇒ Object
readonly
Returns the value of attribute retry_on_non_diff.
-
#tls_cert_chain ⇒ Object
readonly
Returns the value of attribute tls_cert_chain.
-
#tls_private_key ⇒ Object
readonly
Returns the value of attribute tls_private_key.
-
#tls_verify_peer ⇒ Object
readonly
Returns the value of attribute tls_verify_peer.
-
#url ⇒ Object
readonly
Returns the value of attribute url.
Instance Method Summary collapse
- #create(_url) ⇒ Object
-
#initialize(url:, debug: { network: false }, retry_duration: 10, min_duration: 10, retry_on_non_diff: 10, request_method: :get, json_body: nil, headers: {}, enable_gzip_compression: true, tls_cert_chain: nil, tls_private_key: nil, tls_verify_peer: true) ⇒ JSONConfiguration
constructor
A new instance of JSONConfiguration.
Constructor Details
#initialize(url:, debug: { network: false }, retry_duration: 10, min_duration: 10, retry_on_non_diff: 10, request_method: :get, json_body: nil, headers: {}, enable_gzip_compression: true, tls_cert_chain: nil, tls_private_key: nil, tls_verify_peer: true) ⇒ JSONConfiguration
Returns a new instance of JSONConfiguration.
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 |
# File 'lib/consul/async/json_endpoint.rb', line 13 def initialize(url:, debug: { network: false }, retry_duration: 10, min_duration: 10, retry_on_non_diff: 10, request_method: :get, json_body: nil, headers: {}, enable_gzip_compression: true, tls_cert_chain: nil, tls_private_key: nil, tls_verify_peer: true) @url = url @debug = debug @enable_gzip_compression = enable_gzip_compression @retry_duration = retry_duration @min_duration = min_duration @retry_on_non_diff = retry_on_non_diff @request_method = request_method @json_body = json_body @headers = headers @tls_cert_chain = tls_cert_chain @tls_private_key = tls_private_key @tls_verify_peer = tls_verify_peer end |
Instance Attribute Details
#debug ⇒ Object (readonly)
Returns the value of attribute debug.
10 11 12 |
# File 'lib/consul/async/json_endpoint.rb', line 10 def debug @debug end |
#enable_gzip_compression ⇒ Object (readonly)
Returns the value of attribute enable_gzip_compression.
10 11 12 |
# File 'lib/consul/async/json_endpoint.rb', line 10 def enable_gzip_compression @enable_gzip_compression end |
#headers ⇒ Object (readonly)
Returns the value of attribute headers.
10 11 12 |
# File 'lib/consul/async/json_endpoint.rb', line 10 def headers @headers end |
#json_body ⇒ Object (readonly)
Returns the value of attribute json_body.
10 11 12 |
# File 'lib/consul/async/json_endpoint.rb', line 10 def json_body @json_body end |
#min_duration ⇒ Object (readonly)
Returns the value of attribute min_duration.
10 11 12 |
# File 'lib/consul/async/json_endpoint.rb', line 10 def min_duration @min_duration end |
#request_method ⇒ Object (readonly)
Returns the value of attribute request_method.
10 11 12 |
# File 'lib/consul/async/json_endpoint.rb', line 10 def request_method @request_method end |
#retry_duration ⇒ Object (readonly)
Returns the value of attribute retry_duration.
10 11 12 |
# File 'lib/consul/async/json_endpoint.rb', line 10 def retry_duration @retry_duration end |
#retry_on_non_diff ⇒ Object (readonly)
Returns the value of attribute retry_on_non_diff.
10 11 12 |
# File 'lib/consul/async/json_endpoint.rb', line 10 def retry_on_non_diff @retry_on_non_diff end |
#tls_cert_chain ⇒ Object (readonly)
Returns the value of attribute tls_cert_chain.
10 11 12 |
# File 'lib/consul/async/json_endpoint.rb', line 10 def tls_cert_chain @tls_cert_chain end |
#tls_private_key ⇒ Object (readonly)
Returns the value of attribute tls_private_key.
10 11 12 |
# File 'lib/consul/async/json_endpoint.rb', line 10 def tls_private_key @tls_private_key end |
#tls_verify_peer ⇒ Object (readonly)
Returns the value of attribute tls_verify_peer.
10 11 12 |
# File 'lib/consul/async/json_endpoint.rb', line 10 def tls_verify_peer @tls_verify_peer end |
#url ⇒ Object (readonly)
Returns the value of attribute url.
10 11 12 |
# File 'lib/consul/async/json_endpoint.rb', line 10 def url @url end |
Instance Method Details
#create(_url) ⇒ Object
39 40 41 42 |
# File 'lib/consul/async/json_endpoint.rb', line 39 def create(_url) # here we assume we don't need to cache configuration self end |