Class: Mortymer::Rails::Routes

Inherits:
Object
  • Object
show all
Defined in:
lib/mortymer/rails/routes.rb

Overview

This module is in charge of making each registered Morty Endpoint routeable through rails

Instance Method Summary collapse

Constructor Details

#initialize(drawer) ⇒ Routes

Returns a new instance of Routes.



8
9
10
# File 'lib/mortymer/rails/routes.rb', line 8

def initialize(drawer)
  @drawer = drawer
end

Instance Method Details

#mount_controllersObject



18
19
20
21
22
# File 'lib/mortymer/rails/routes.rb', line 18

def mount_controllers
  Mortymer::EndpointRegistry.registry.each do |endpoint|
    mount_controller(endpoint)
  end
end

#mount_morty_endpointsObject



12
13
14
15
16
# File 'lib/mortymer/rails/routes.rb', line 12

def mount_morty_endpoints
  Mortymer::EndpointRegistry.registry.each do |endpoint|
    mount_endpoint(endpoint)
  end
end