Module: Olelo::Routing::ClassMethods

Defined in:
lib/olelo/routing.rb

Instance Method Summary collapse

Instance Method Details

#delete(path, patterns = {}, &block) ⇒ Object



209
210
211
# File 'lib/olelo/routing.rb', line 209

def delete(path, patterns = {}, &block)
  add_route('DELETE', path, patterns, &block)
end

#get(path, patterns = {}, &block) ⇒ Object



196
197
198
199
# File 'lib/olelo/routing.rb', line 196

def get(path, patterns = {}, &block)
  add_route('GET',  path, patterns, &block)
  add_route('HEAD', path, patterns, &block)
end

#patterns(patterns = nil) ⇒ Object



191
192
193
194
# File 'lib/olelo/routing.rb', line 191

def patterns(patterns = nil)
  @patterns ||= Hash.with_indifferent_access
  patterns ? @patterns.merge!(patterns) : @patterns
end

#post(path, patterns = {}, &block) ⇒ Object



205
206
207
# File 'lib/olelo/routing.rb', line 205

def post(path, patterns = {}, &block)
  add_route('POST', path, patterns, &block)
end

#put(path, patterns = {}, &block) ⇒ Object



201
202
203
# File 'lib/olelo/routing.rb', line 201

def put(path, patterns = {}, &block)
  add_route('PUT', path, patterns, &block)
end

#routerObject



187
188
189
# File 'lib/olelo/routing.rb', line 187

def router
  @router ||= {}
end