Skip to content

Commit

Permalink
Merge b3b45de into 8ffe7ce
Browse files Browse the repository at this point in the history
  • Loading branch information
balasankarc committed Feb 7, 2020
2 parents 8ffe7ce + b3b45de commit c387581
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/yell/level.rb
Expand Up @@ -42,6 +42,7 @@ class Level
# @param [Integer,String,Symbol,Array,Range,nil] severity The severity for the level.
def initialize( *severities )
set(*severities)
@tainted = false
end

# Set the severity to the given format
Expand Down Expand Up @@ -176,7 +177,7 @@ def calculate!( modifier, severity )
else set!( index ) # :==
end

taint unless tainted?
@tainted = true unless @tainted
end

def index_from( severity )
Expand All @@ -203,7 +204,7 @@ def each
end

def set!( index, val = true )
@severities.map! { false } unless tainted?
@severities.map! { false } unless @tainted

@severities[index] = val
end
Expand Down

0 comments on commit c387581

Please sign in to comment.