class Swee::Routes

Public Class Methods

_parse(_m,*args) click to toggle source
# File lib/swee/routes.rb, line 36
def _parse _m,*args
  _path_info = args[0].to_s
  if args[1] =~ /^(.*)#(.*)$/
    @@tables[_path_info] = RouteStruct.new $1,$2, _m == "match" ? args[2][:via].map(&:to_sym) : [_m.to_sym]
  else
    raise "routes error!"
  end
end
get(*args) click to toggle source
# File lib/swee/routes.rb, line 20
def get *args
  self._parse "get",*args
end
match(*args) click to toggle source
# File lib/swee/routes.rb, line 28
def match *args
  self._parse "match",*args
end
post(*args) click to toggle source
# File lib/swee/routes.rb, line 24
def post *args
  self._parse "post",*args
end
tables() click to toggle source
# File lib/swee/routes.rb, line 32
def tables
  @@tables
end