Class: Dao::Route::List

Inherits:
Array
  • Object
show all
Defined in:
lib/dao/route.rb

Instance Method Summary collapse

Methods inherited from Array

#as_dao, #to_dao

Instance Method Details

#add(path) ⇒ Object



74
75
76
77
78
# File 'lib/dao/route.rb', line 74

def add(path)
  route = Route.new(path)
  push(route)
  route
end

#match(name) ⇒ Object



80
81
82
83
84
85
86
# File 'lib/dao/route.rb', line 80

def match(name)
  each do |route|
    match = route.match(name)
    return route unless match.empty?
  end
  return nil
end