Class: RackStep::Route

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(verb, path, controller) ⇒ Route

Returns a new instance of Route.



11
12
13
14
15
# File 'lib/route.rb', line 11

def initialize(verb, path, controller)
  @verb = verb
  @path = path
  @controller = controller
end

Instance Attribute Details

#controllerObject

Returns the value of attribute controller.



9
10
11
# File 'lib/route.rb', line 9

def controller
  @controller
end

#pathObject

Returns the value of attribute path.



9
10
11
# File 'lib/route.rb', line 9

def path
  @path
end

#verbObject

Returns the value of attribute verb.



9
10
11
# File 'lib/route.rb', line 9

def verb
  @verb
end

Instance Method Details

#idObject

Unique id (String) of the route (verb + path). Eg: ‘GETuser’.



18
19
20
# File 'lib/route.rb', line 18

def id
  verb + path
end