Class: Configuration::InclusionMatcher

Inherits:
Object
  • Object
show all
Defined in:
lib/httpimagestore/configuration/handler.rb

Instance Method Summary collapse

Constructor Details

#initialize(value, template) ⇒ InclusionMatcher

Returns a new instance of InclusionMatcher.



184
185
186
187
# File 'lib/httpimagestore/configuration/handler.rb', line 184

def initialize(value, template)
	@value = value
	@template = RubyStringTemplate.new(template) if template
end

Instance Method Details

#included?(request_state) ⇒ Boolean

Returns:

  • (Boolean)


189
190
191
192
# File 'lib/httpimagestore/configuration/handler.rb', line 189

def included?(request_state)
	return true if not @template
	@template.render(request_state).split(',').include? @value
end