From caa3d5a393339eac45f48aaf464b494b3282e0e1 Mon Sep 17 00:00:00 2001 From: HAHWUL Date: Sun, 30 Jun 2024 18:01:40 +0900 Subject: [PATCH] feat: Add Caido::Instance class with scopes and scope methods --- lib/caido/helpers/scope.rb | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 lib/caido/helpers/scope.rb diff --git a/lib/caido/helpers/scope.rb b/lib/caido/helpers/scope.rb new file mode 100644 index 0000000..e505fad --- /dev/null +++ b/lib/caido/helpers/scope.rb @@ -0,0 +1,30 @@ +# frozen_string_literal: true + +module Caido + # Instance class + class Instance + def scopes + query("query{ + scopes{ + id + name + allowlist + denylist + indexed + } + }")['scopes'] + end + + def scope(id) + query("query{ + scope(id: \"#{id}\"){ + id + name + allowlist + denylist + indexed + } + }")['scope'] + end + end +end