module Operations::Config

Public Class Methods

get_operations_list() click to toggle source
# File lib/operations/config.rb, line 57
def self.get_operations_list
  operations_list
      .map{|operation|
        Operations::Operation.new(**operation)}
      .select{|operation| operation.is_valid?}
end
get_sign_in_path() click to toggle source
# File lib/operations/config.rb, line 41
def get_sign_in_path
  if sign_in_path.nil?
    warn "Warning! You have not set the Operations::Config.sign_in_path variable!"
    return nil
  end
  Rails.application.routes.recognize_path sign_in_path
rescue ActionController::RoutingError
  {controller: nil, action: nil}
end
operation_scope_regex() click to toggle source
# File lib/operations/config.rb, line 33
def operation_scope_regex
  %r{\A(#{user_roles.map{|o| o[:name]}.join('|')})\z}
end
operation_scope_regex=(*args) click to toggle source
# File lib/operations/config.rb, line 37
def operation_scope_regex=(*args)
  raise 'Operations::Config does not allow to set the variable operation_name_regex'
end
setup() { |self| ... } click to toggle source

A simple way to setup Operations.

# File lib/operations/config.rb, line 53
def self.setup
  yield self
end