class Decidim::Verifications::Registry

Takes care of holding and accessing verification methods.

Public Instance Methods

add_workflow(manifest) click to toggle source
# File lib/decidim/verifications/registry.rb, line 21
def add_workflow(manifest)
  manifest.validate!
  workflow_collection.add(manifest)
end
clear_workflows() click to toggle source
# File lib/decidim/verifications/registry.rb, line 26
def clear_workflows
  workflow_collection.clear
end
register_workflow(name) { |manifest| ... } click to toggle source
# File lib/decidim/verifications/registry.rb, line 11
def register_workflow(name)
  manifest = WorkflowManifest.new(name: name.to_s)
  yield(manifest)
  add_workflow(manifest)
end
reset_workflows(*manifests) click to toggle source
# File lib/decidim/verifications/registry.rb, line 30
def reset_workflows(*manifests)
  clear_workflows

  manifests.each do |manifest|
    add_workflow(manifest)
  end
end
unregister_workflow(manifest) click to toggle source
# File lib/decidim/verifications/registry.rb, line 17
def unregister_workflow(manifest)
  workflow_collection.delete(manifest)
end
workflow_collection() click to toggle source
# File lib/decidim/verifications/registry.rb, line 38
def workflow_collection
  @workflow_collection ||= Set.new
end