Module: LogShusher

Extended by:
LogShusher
Included in:
LogShusher
Defined in:
lib/log_shusher.rb

Overview

Requests will be logged if the following block evaluates to nil or false:

LogShusher.shush do |env|

# ...

end

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#shush_conditionObject

Returns the value of attribute shush_condition.



9
10
11
# File 'lib/log_shusher.rb', line 9

def shush_condition
  @shush_condition
end

Instance Method Details

#shush(&block) ⇒ Object



11
12
13
14
15
# File 'lib/log_shusher.rb', line 11

def shush(&block)
  self.shush_condition = block
  shush_rails
  shush_rack
end

#shush?(env) ⇒ Boolean

Returns:

  • (Boolean)


17
18
19
# File 'lib/log_shusher.rb', line 17

def shush?(env)
  self.shush_condition.call env
end