Class: Dry::ResourceRoutes

Inherits:
Object
  • Object
show all
Defined in:
lib/dry/resource_routes.rb

Instance Method Summary collapse

Constructor Details

#initialize(routes, path) ⇒ ResourceRoutes

Returns a new instance of ResourceRoutes.



3
4
5
6
# File 'lib/dry/resource_routes.rb', line 3

def initialize routes, path
  @routes = routes
  @path   = path
end

Instance Method Details

#routesObject



8
9
10
11
12
# File 'lib/dry/resource_routes.rb', line 8

def routes
  routes_for_path(@path).each_with_object([]) do |e, m|
    m << e.defaults[:action].to_sym
  end.uniq
end