Class: FastlyNsq::TlsOptions
- Inherits:
-
Object
- Object
- FastlyNsq::TlsOptions
- Defined in:
- lib/fastly_nsq/tls_options.rb
Class Method Summary collapse
-
.as_hash(context = nil) ⇒ Object
Return hash of TLS options for creating an NSQ connection.
Instance Method Summary collapse
-
#initialize(context = nil) ⇒ TlsOptions
constructor
A new instance of TlsOptions.
- #to_h ⇒ Object
Constructor Details
#initialize(context = nil) ⇒ TlsOptions
Returns a new instance of TlsOptions.
12 13 14 |
# File 'lib/fastly_nsq/tls_options.rb', line 12 def initialize(context = nil) @context = context || {} end |
Class Method Details
.as_hash(context = nil) ⇒ Object
Return hash of TLS options for creating an NSQ connection.
8 9 10 |
# File 'lib/fastly_nsq/tls_options.rb', line 8 def self.as_hash(context = nil) new(context).to_h end |
Instance Method Details
#to_h ⇒ Object
16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/fastly_nsq/tls_options.rb', line 16 def to_h merge_contexts if @context.empty? {} else { tls_v1: true, tls_options: @context } end end |