Class: Waw::StaticController::AbstractMatcher
- Includes:
- Waw::ScopeUtils
- Defined in:
- lib/waw/controllers/static/matcher.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#wawaccess ⇒ Object
readonly
Waw access on which this matcher is defined.
Instance Method Summary collapse
- #&(other) ⇒ Object
-
#folder ⇒ Object
Returns wawaccess’s folder.
-
#initialize(wawaccess) ⇒ AbstractMatcher
constructor
A new instance of AbstractMatcher.
- #negate ⇒ Object
-
#req_path ⇒ Object
Returns requested path.
- #|(other) ⇒ Object
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) ⇒ AbstractMatcher
Returns a new instance of AbstractMatcher.
9 10 11 |
# File 'lib/waw/controllers/static/matcher.rb', line 9 def initialize(wawaccess) @wawaccess = wawaccess end |
Instance Attribute Details
#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
#&(other) ⇒ Object
23 24 25 26 27 28 |
# File 'lib/waw/controllers/static/matcher.rb', line 23 def &(other) unless other.is_a?(AbstractMatcher) raise ArgumentError, "Matcher expected for &, #{other} received" end AndMatcher.new(wawaccess, self, other) end |
#folder ⇒ Object
Returns wawaccess’s folder
14 15 16 |
# File 'lib/waw/controllers/static/matcher.rb', line 14 def folder wawaccess.folder end |
#negate ⇒ Object
37 38 39 |
# File 'lib/waw/controllers/static/matcher.rb', line 37 def negate NegateMatcher.new(wawaccess, self) end |
#req_path ⇒ Object
Returns requested path
19 20 21 |
# File 'lib/waw/controllers/static/matcher.rb', line 19 def req_path wawaccess.req_path end |
#|(other) ⇒ Object
30 31 32 33 34 35 |
# File 'lib/waw/controllers/static/matcher.rb', line 30 def |(other) unless other.is_a?(AbstractMatcher) raise ArgumentError, "Matcher expected for |, #{other} received" end OrMatcher.new(wawaccess, self, other) end |