Class: Turbo::Train::Configuration
- Inherits:
-
Object
- Object
- Turbo::Train::Configuration
- Defined in:
- lib/turbo/train/config.rb
Instance Attribute Summary collapse
-
#anycable ⇒ Object
Returns the value of attribute anycable.
-
#default_server ⇒ Object
Returns the value of attribute default_server.
-
#fanout ⇒ Object
Returns the value of attribute fanout.
-
#mercure ⇒ Object
Returns the value of attribute mercure.
-
#skip_ssl_verification ⇒ Object
Returns the value of attribute skip_ssl_verification.
Instance Method Summary collapse
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
- #server(server_name) ⇒ Object
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
71 72 73 74 75 76 77 |
# File 'lib/turbo/train/config.rb', line 71 def initialize @skip_ssl_verification = Rails.env.development? || Rails.env.test? @mercure = nil @fanout = nil @anycable = nil @default_server = :mercure end |
Instance Attribute Details
#anycable ⇒ Object
Returns the value of attribute anycable.
69 70 71 |
# File 'lib/turbo/train/config.rb', line 69 def anycable @anycable end |
#default_server ⇒ Object
Returns the value of attribute default_server.
69 70 71 |
# File 'lib/turbo/train/config.rb', line 69 def default_server @default_server end |
#fanout ⇒ Object
Returns the value of attribute fanout.
69 70 71 |
# File 'lib/turbo/train/config.rb', line 69 def fanout @fanout end |
#mercure ⇒ Object
Returns the value of attribute mercure.
69 70 71 |
# File 'lib/turbo/train/config.rb', line 69 def mercure @mercure end |
#skip_ssl_verification ⇒ Object
Returns the value of attribute skip_ssl_verification.
69 70 71 |
# File 'lib/turbo/train/config.rb', line 69 def skip_ssl_verification @skip_ssl_verification end |
Instance Method Details
#server(server_name) ⇒ Object
79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 |
# File 'lib/turbo/train/config.rb', line 79 def server(server_name) case server_name when :mercure @mercure ||= MercureConfiguration.new yield(@mercure) when :fanout @fanout ||= FanoutConfiguration.new yield(@fanout) when :anycable @anycable ||= AnycableConfiguration.new yield(@anycable) else raise ArgumentError, "Unknown server name: #{server_name}" end end |