Module: Configuration::HandlerStatement::ConditionalInclusion

Defined in:
lib/httpimagestore/configuration/handler.rb

Instance Method Summary collapse

Instance Method Details

#excluded?(request_state) ⇒ Boolean

Returns:

  • (Boolean)


241
242
243
# File 'lib/httpimagestore/configuration/handler.rb', line 241

def excluded?(request_state)
  not included? request_state
end

#included?(request_state) ⇒ Boolean

Returns:

  • (Boolean)


234
235
236
237
238
239
# File 'lib/httpimagestore/configuration/handler.rb', line 234

def included?(request_state)
  return true if @matchers.empty?
  @matchers.any? do |matcher|
    matcher.included?(request_state)
  end
end

#inclusion_matcher(matcher) ⇒ Object



230
231
232
# File 'lib/httpimagestore/configuration/handler.rb', line 230

def inclusion_matcher(matcher)
  @matchers << matcher
end

#initialize(global, *args) ⇒ Object



223
224
225
226
227
228
# File 'lib/httpimagestore/configuration/handler.rb', line 223

def initialize(global, *args)
  @matchers = []
  matcher = args.pop
  @matchers << matcher if matcher
  super(global, *args)
end