Class: PreCommit::Configuration::Providers::Default

Inherits:
Object
  • Object
show all
Defined in:
lib/plugins/pre_commit/configuration/providers/default.rb

Constant Summary collapse

DEFAULTS =
{
  :warnings => [],
  :checks   => [:common, :rails]
}

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(defaults = nil) ⇒ Default

Returns a new instance of Default.



19
20
21
# File 'lib/plugins/pre_commit/configuration/providers/default.rb', line 19

def initialize(defaults = nil)
  @defaults = defaults || DEFAULTS
end

Class Method Details

.priorityObject



15
16
17
# File 'lib/plugins/pre_commit/configuration/providers/default.rb', line 15

def self.priority
  0
end

Instance Method Details

#[](name) ⇒ Object



23
24
25
# File 'lib/plugins/pre_commit/configuration/providers/default.rb', line 23

def [](name)
  @defaults[name]
end

#update(name, value) ⇒ Object



27
28
29
# File 'lib/plugins/pre_commit/configuration/providers/default.rb', line 27

def update(name, value)
  raise PreCommit::CanNotUpdateDefauls.new("Can not update default settings")
end