Class: ApiMapper::Route
- Inherits:
-
Object
- Object
- ApiMapper::Route
- Defined in:
- lib/api_mapper/router.rb
Instance Attribute Summary collapse
-
#mapper ⇒ Object
readonly
Returns the value of attribute mapper.
Instance Method Summary collapse
-
#initialize(method, path, mapper) ⇒ Route
constructor
A new instance of Route.
- #match(method, path) ⇒ Object
Constructor Details
#initialize(method, path, mapper) ⇒ Route
Returns a new instance of Route.
33 34 35 36 37 |
# File 'lib/api_mapper/router.rb', line 33 def initialize(method, path, mapper) @method = method @path = Addressable::Template.new(path) @mapper = mapper end |
Instance Attribute Details
#mapper ⇒ Object (readonly)
Returns the value of attribute mapper.
31 32 33 |
# File 'lib/api_mapper/router.rb', line 31 def mapper @mapper end |
Instance Method Details
#match(method, path) ⇒ Object
39 40 41 |
# File 'lib/api_mapper/router.rb', line 39 def match(method, path) @method == method && @path.match(path) end |