Module: Crystal::NamedRouter::Helper

Included in:
AbstractController, ControllerContext
Defined in:
lib/crystal/router/named_router.rb

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(m, *args, &block) ⇒ Object (protected)



53
54
55
56
57
58
59
60
# File 'lib/crystal/router/named_router.rb', line 53

def method_missing m, *args, &block
  m = m.to_s
  if m =~ /_path$/
    crystal[:router].routes[:named_router].encode_route_method m, *args
  else
    super m.to_sym, *args, &block
  end
end