Class: ImproveYourCode::Overrides
- Inherits:
-
Object
- Object
- ImproveYourCode::Overrides
- Defined in:
- lib/improve_your_code/smell_configuration.rb
Instance Method Summary collapse
- #for_context(context) ⇒ Object
-
#initialize(hash) ⇒ Overrides
constructor
A new instance of Overrides.
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 |