class HaveAPI::Route
Attributes
action[R]
path[R]
resource_path[R]
sinatra_path[R]
Public Class Methods
new(path, action, resource_path)
click to toggle source
# File lib/haveapi/route.rb, line 5 def initialize(path, action, resource_path) @path = path @sinatra_path = path.gsub(/:([a-zA-Z\-_]+)/, '{\1}') @action = action @resource_path = resource_path end
Public Instance Methods
description()
click to toggle source
# File lib/haveapi/route.rb, line 16 def description @action.desc end
http_method()
click to toggle source
# File lib/haveapi/route.rb, line 12 def http_method @action.http_method end
params()
click to toggle source
# File lib/haveapi/route.rb, line 20 def params @action.params end