module Para::Config

Public Class Methods

add_actions_for(*types, &block) click to toggle source
# File lib/para/config.rb, line 99
def self.add_actions_for(*types, &block)
  types.each do |type|
    page_actions_for(type) << block
  end
end
jobs_store() click to toggle source

Default to use Para::Cache::DatabaseStore, allowing cross process and app instances job status sharing

# File lib/para/config.rb, line 63
def self.jobs_store
  @@jobs_store ||= Para::Cache::DatabaseStore.new
end
jobs_store=(store) click to toggle source

Allows changing default cache store used by Para to store jobs through the ActiveJob::Status gem

# File lib/para/config.rb, line 55
def self.jobs_store=(store)
  @@jobs_store = store
  ActiveJob::Status.store = store
end
method_missing(method_name, *args, &block) click to toggle source

Allows accessing plugins root module to configure them through a method from the Para::Config class.

Example :

Para.config do |config|
  config.my_plugin.my_var = 'foo'
end
Calls superclass method
# File lib/para/config.rb, line 82
def self.method_missing(method_name, *args, &block)
  if plugins.include?(method_name)
    plugin = Para::Plugins.module_name_for(method_name).constantize
    block ? block.call(plugin) : plugin
  else
    super
  end
end
page_actions_for(type) click to toggle source
# File lib/para/config.rb, line 95
def self.page_actions_for(type)
  page_actions[type] ||= []
end
plugins=(array) click to toggle source
# File lib/para/config.rb, line 31
def self.plugins=(array)
  # Add each item in array to the existing plugins set
  array.each(&plugins.method(:<<))
end
routes() click to toggle source
# File lib/para/config.rb, line 91
def self.routes
  Para::Routes
end