lib/rack/queries/app.rb in rack-queries-0.2.1 vs lib/rack/queries/app.rb in rack-queries-0.3.0
- old
+ new
@@ -5,11 +5,12 @@
module App
class Controller
# Thought about refactoring this to split it out into multiple objects,
# but then thought better of it. If we end up adding more API endpoints
# then we can do something smart about it, but for now it's fine.
- # rubocop:disable AbcSize, CyclomaticComplexity, MethodLength
+ # rubocop:disable Metrics/AbcSize, Metrics/CyclomaticComplexity
+ # rubocop:disable Metrics/MethodLength
def call(env)
return not_found unless env[REQUEST_METHOD]
case Utils.unescape(env[PATH_INFO])
when %r{\A/queries/(.+)/opts/(.+)\z}i
@@ -25,10 +26,11 @@
json(queries: Cache.queries)
else
not_found
end
end
- # rubocop:enable AbcSize, CyclomaticComplexity, MethodLength
+ # rubocop:enable Metrics/AbcSize, Metrics/CyclomaticComplexity
+ # rubocop:enable Metrics/MethodLength
private
def json(body)
[200, { 'Content-Type' => 'application/json' }, [JSON.dump(body)]]