Class: Twirp::Rails::Configuration
- Inherits:
-
Object
- Object
- Twirp::Rails::Configuration
- Defined in:
- lib/twirp/rails/configuration.rb
Instance Attribute Summary collapse
-
#auto_mount ⇒ Object
Whether to automatically mount routes at endpoint.
-
#endpoint ⇒ Object
Where to mount twirp routes.
-
#load_paths ⇒ Object
An array of directories to search for *_twirp.rb files Defaults to [“lib”].
-
#middleware ⇒ Object
An array of Rack middleware to use.
-
#service_hooks ⇒ Object
A hash of lambdas that accepts |rack_env, env| and is passed to Twirp::Service See: github.com/twitchtv/twirp-ruby/wiki/Service-Hooks for available hooks.
Instance Method Summary collapse
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
24 25 26 27 28 29 30 |
# File 'lib/twirp/rails/configuration.rb', line 24 def initialize @auto_mount = false @endpoint = "/twirp" @load_paths = ["lib"] @middleware = [] @service_hooks = {} end |
Instance Attribute Details
#auto_mount ⇒ Object
Whether to automatically mount routes at endpoint. Defaults to false
7 8 9 |
# File 'lib/twirp/rails/configuration.rb', line 7 def auto_mount @auto_mount end |
#endpoint ⇒ Object
Where to mount twirp routes. Defaults to /twirp
10 11 12 |
# File 'lib/twirp/rails/configuration.rb', line 10 def endpoint @endpoint end |
#load_paths ⇒ Object
An array of directories to search for *_twirp.rb files Defaults to [“lib”]
14 15 16 |
# File 'lib/twirp/rails/configuration.rb', line 14 def load_paths @load_paths end |
#middleware ⇒ Object
An array of Rack middleware to use
17 18 19 |
# File 'lib/twirp/rails/configuration.rb', line 17 def middleware @middleware end |
#service_hooks ⇒ Object
A hash of lambdas that accepts |rack_env, env| and is passed to Twirp::Service See: github.com/twitchtv/twirp-ruby/wiki/Service-Hooks for available hooks
22 23 24 |
# File 'lib/twirp/rails/configuration.rb', line 22 def service_hooks @service_hooks end |