Class: Exception2dbConfig

Inherits:
Object
  • Object
show all
Defined in:
lib/exception2db/config.rb

Class Method Summary collapse

Class Method Details

.initialize_defaultsObject



13
14
15
16
17
18
19
20
# File 'lib/exception2db/config.rb', line 13

def self.initialize_defaults
  self.setting = {
    :plugin_dir => File.expand_path(File.join(File.dirname(__FILE__), '..', '..')),
    :will_paginate_per_page => 50,
    # cucumber test was failing with Rails.env.development? . Need to investigate further TODO
    :is_allowed_to_view => lambda { |controller| return true if RAILS_ENV == 'development' }
  }
end

.set=(input = {}) ⇒ Object



5
6
7
8
9
10
11
# File 'lib/exception2db/config.rb', line 5

def self.set=(input = {})
  valid_keys = %w(is_allowed_to_view).collect(&:intern)
  extra_keys = input.keys - valid_keys
  raise "Following options are not supported. #{extra_keys.inspect}" unless extra_keys.blank?
  self.setting ||= {}
  self.setting.merge!(input)
end