Class: Turbo::Train::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/turbo/train/config.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

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

#anycableObject

Returns the value of attribute anycable.



69
70
71
# File 'lib/turbo/train/config.rb', line 69

def anycable
  @anycable
end

#default_serverObject

Returns the value of attribute default_server.



69
70
71
# File 'lib/turbo/train/config.rb', line 69

def default_server
  @default_server
end

#fanoutObject

Returns the value of attribute fanout.



69
70
71
# File 'lib/turbo/train/config.rb', line 69

def fanout
  @fanout
end

#mercureObject

Returns the value of attribute mercure.



69
70
71
# File 'lib/turbo/train/config.rb', line 69

def mercure
  @mercure
end

#skip_ssl_verificationObject

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