Class: ImproveYourCode::Overrides

Inherits:
Object
  • Object
show all
Defined in:
lib/improve_your_code/smell_configuration.rb

Instance Method Summary collapse

Constructor Details

#initialize(hash) ⇒ Overrides

Returns a new instance of Overrides.



35
36
37
# File 'lib/improve_your_code/smell_configuration.rb', line 35

def initialize(hash)
  @hash = hash
end

Instance Method Details

#for_context(context) ⇒ Object



39
40
41
42
# File 'lib/improve_your_code/smell_configuration.rb', line 39

def for_context(context)
  contexts = hash.keys.select { |ckey| context.matches?([ckey]) }
  contexts.map { |exc| hash[exc] }
end