Added Route file and class

This commit is contained in:
Hannah-Dagemark 2023-12-04 10:19:08 +01:00
commit 12653f6f48
3 changed files with 31 additions and 0 deletions

View file

@ -0,0 +1,21 @@
class Route
attr_reader :routes
def initialize()
@routes = {}
end
def add_route(input)
@routes.merge!(input)
p "added successfully, @routes are: #{@routes}"
end
def match_route(input)
resource = input.resource
if @routes[resource]
return @routes[resource]
else
p "failed to find: #{resource} route"
end
end
end