Class: Paquette::Routes::RouteBuilder

Inherits:
Object
  • Object
show all
Defined in:
lib/paquette/routes.rb

Instance Method Summary collapse

Constructor Details

#initialize(routes) ⇒ RouteBuilder

Returns a new instance of RouteBuilder.



34
35
36
# File 'lib/paquette/routes.rb', line 34

def initialize(routes)
  @routes = routes
end

Instance Method Details

#delete(pattern, &block) ⇒ Object



50
51
52
# File 'lib/paquette/routes.rb', line 50

def delete(pattern, &block)
  @routes << Route.new("DELETE", pattern, block)
end

#get(pattern, &block) ⇒ Object



38
39
40
# File 'lib/paquette/routes.rb', line 38

def get(pattern, &block)
  @routes << Route.new("GET", pattern, block)
end

#patch(pattern, &block) ⇒ Object



54
55
56
# File 'lib/paquette/routes.rb', line 54

def patch(pattern, &block)
  @routes << Route.new("PATCH", pattern, block)
end

#post(pattern, &block) ⇒ Object



42
43
44
# File 'lib/paquette/routes.rb', line 42

def post(pattern, &block)
  @routes << Route.new("POST", pattern, block)
end

#put(pattern, &block) ⇒ Object



46
47
48
# File 'lib/paquette/routes.rb', line 46

def put(pattern, &block)
  @routes << Route.new("PUT", pattern, block)
end