Class: Webhookdb::SavedQuery

Inherits:
Object
  • Object
show all
Defined in:
lib/webhookdb/saved_query.rb

Constant Summary collapse

CLI_EDITABLE_FIELDS =
["description", "sql", "public"].freeze
INFO_FIELDS =
{
  "id" => :opaque_id,
  "description" => :description,
  "public" => :public,
  "run_url" => :run_url,
  "sql" => :sql,
}.freeze
DOCS_URL =
"https://docs.webhookdb.com/docs/integrating/saved-queries.html"

Instance Method Summary collapse

Instance Method Details

#before_createObject



23
24
25
26
# File 'lib/webhookdb/saved_query.rb', line 23

def before_create
  self[:opaque_id] ||= Webhookdb::Id.new_opaque_id("svq")
  super
end

#private?Boolean

Returns:

  • (Boolean)


21
# File 'lib/webhookdb/saved_query.rb', line 21

def private? = !self.public?

#run_urlObject



28
# File 'lib/webhookdb/saved_query.rb', line 28

def run_url = "#{Webhookdb.api_url}/v1/saved_queries/#{self.opaque_id}/run"