Class: Auditor::Config

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

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(*args) ⇒ Config

Returns a new instance of Config.



10
11
12
13
14
15
16
# File 'lib/auditor/config.rb', line 10

def initialize(*args)
  @options = (args.pop if args.last.kind_of?(Hash)) || {}
  normalize_options(@options)

  @actions = args.map(&:to_sym)
  validate_actions(@actions)
end

Instance Attribute Details

#actionsObject (readonly)

Returns the value of attribute actions.



3
4
5
# File 'lib/auditor/config.rb', line 3

def actions
  @actions
end

#optionsObject (readonly)

Returns the value of attribute options.



4
5
6
# File 'lib/auditor/config.rb', line 4

def options
  @options
end

Class Method Details

.valid_actionsObject



6
7
8
# File 'lib/auditor/config.rb', line 6

def self.valid_actions
  @valid_actions ||= [:create, :find, :update, :destroy]
end