Class: Waw::StaticController::Matcher
- Includes:
- Waw::ScopeUtils
- Defined in:
- lib/waw/controllers/static/matcher.rb
Instance Attribute Summary collapse
-
#predicate ⇒ Object
readonly
Matcher’s predicate.
-
#wawaccess ⇒ Object
readonly
Waw access on which this matcher is defined.
Instance Method Summary collapse
-
#folder ⇒ Object
Returns wawaccess’s folder.
-
#initialize(wawaccess, predicate) ⇒ Matcher
constructor
Creates a matcher instance.
-
#matches?(env) ⇒ Boolean
Does the matcher matches a given path?.
-
#req_path ⇒ Object
Returns requested 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
13 14 15 16 |
# File 'lib/waw/controllers/static/matcher.rb', line 13 def initialize(wawaccess, predicate) @wawaccess = wawaccess @predicate = predicate end |
Instance Attribute Details
#predicate ⇒ Object (readonly)
Matcher’s predicate
10 11 12 |
# File 'lib/waw/controllers/static/matcher.rb', line 10 def predicate @predicate end |
#wawaccess ⇒ Object (readonly)
Waw access on which this matcher is defined
7 8 9 |
# File 'lib/waw/controllers/static/matcher.rb', line 7 def wawaccess @wawaccess end |
Instance Method Details
#folder ⇒ Object
Returns wawaccess’s folder
19 20 21 |
# File 'lib/waw/controllers/static/matcher.rb', line 19 def folder wawaccess.folder end |
#matches?(env) ⇒ Boolean
Does the matcher matches a given path?
29 30 31 |
# File 'lib/waw/controllers/static/matcher.rb', line 29 def matches?(env) instance_eval &predicate end |
#req_path ⇒ Object
Returns requested path
24 25 26 |
# File 'lib/waw/controllers/static/matcher.rb', line 24 def req_path wawaccess.req_path end |