class Route

Attributes

action[R]
mat_controller[R]
matclass[R]

Public Class Methods

new(route_info) click to toggle source
# File lib/matrack/route.rb, line 4
def initialize(route_info)
  matklass = route_info.last[:matclass].to_camel_case
  @matclass = Object.const_get(matklass+"Controller")
  @path = route_info.first
  @action = route_info.last[:method].to_sym
end

Public Instance Methods

execute(env) click to toggle source
# File lib/matrack/route.rb, line 11
def execute(env)
  @mat_controller = matclass.new(env)
  @mat_controller.send(action)
end