Class: Telebugs::Middleware::IgnoreEnvironments

Inherits:
BaseMiddleware show all
Defined in:
lib/telebugs/middleware/ignore_environments.rb

Constant Summary

Constants inherited from BaseMiddleware

BaseMiddleware::DEFAULT_WEIGHT

Instance Method Summary collapse

Constructor Details

#initialize(current_env, ignore_envs) ⇒ IgnoreEnvironments

Returns a new instance of IgnoreEnvironments.



6
7
8
9
# File 'lib/telebugs/middleware/ignore_environments.rb', line 6

def initialize(current_env, ignore_envs)
  @current_env = current_env
  @ignore_envs = ignore_envs
end

Instance Method Details

#call(report) ⇒ Object



11
12
13
# File 'lib/telebugs/middleware/ignore_environments.rb', line 11

def call(report)
  report.ignored = @ignore_envs.include?(@current_env)
end

#weightObject



15
16
17
# File 'lib/telebugs/middleware/ignore_environments.rb', line 15

def weight
  -1000
end