Method: Appfuel::Handler::Action#dispatch

Defined in:
lib/appfuel/handler/action.rb

#dispatch(route, payload = {}) ⇒ Object



19
20
21
22
23
24
25
26
27
28
# File 'lib/appfuel/handler/action.rb', line 19

def dispatch(route, payload = {})
  route = route.to_s
  fail "route can not be empty" if route.empty?

  unless route.include?('/')
    route = "#{self.class.container_feature_name}/#{route}"
  end
  root  = app_container[:root]
  root.call(route, payload)
end