Class: Waw::StaticController::Matcher

Inherits:
AbstractMatcher show all
Defined in:
lib/waw/controllers/static/matcher.rb

Instance Attribute Summary collapse

Attributes inherited from AbstractMatcher

#wawaccess

Instance Method Summary collapse

Methods inherited from AbstractMatcher

#&, #folder, #negate, #req_path, #|

Methods included from Waw::ScopeUtils

#config, #find_kernel_context, #logger, #params, #rack_env, #real_session, #request, #resources, #response, #root_folder, #session

Constructor Details

#initialize(wawaccess, predicate) ⇒ Matcher

Creates a matcher instance



49
50
51
52
# File 'lib/waw/controllers/static/matcher.rb', line 49

def initialize(wawaccess, predicate)
  super(wawaccess)
  @predicate = predicate
end

Instance Attribute Details

#predicateObject (readonly)

Matcher’s predicate



46
47
48
# File 'lib/waw/controllers/static/matcher.rb', line 46

def predicate
  @predicate
end

Instance Method Details

#matches?(env) ⇒ Boolean

Does the matcher matches a given path?

Returns:



55
56
57
# File 'lib/waw/controllers/static/matcher.rb', line 55

def matches?(env)
  instance_eval &predicate
end