Class: Trifle::Docs::Engine

Inherits:
Rails::Engine
  • Object
show all
Defined in:
lib/trifle/docs/engine.rb

Class Method Summary collapse

Class Method Details

.drawObject



17
18
19
20
21
22
# File 'lib/trifle/docs/engine.rb', line 17

def self.draw
  Trifle::Docs::Engine.routes.draw do
    root to: 'page#show'
    get '*url', to: 'page#show'
  end
end

.mount(router, namespace:) {|configuration| ... } ⇒ Object

Yields:

  • (configuration)


9
10
11
12
13
14
15
# File 'lib/trifle/docs/engine.rb', line 9

def self.mount(router, namespace:)
  configuration = Configuration.new
  configuration.namespace = namespace
  yield(configuration)

  router.mount self => "/#{namespace}", as: namespace, configuration: configuration
end