Class: Hx::Path::ElideCircumfix
- Inherits:
-
Object
- Object
- Hx::Path::ElideCircumfix
- Includes:
- Selector
- Defined in:
- lib/hx/path.rb
Class Method Summary collapse
Instance Method Summary collapse
- #accept_path?(path) ⇒ Boolean
-
#initialize(selector, prefix, suffix) ⇒ ElideCircumfix
constructor
A new instance of ElideCircumfix.
Methods included from Selector
#&, #assume_circumfix, #elide_circumfix, #literal?, #|, #~
Constructor Details
#initialize(selector, prefix, suffix) ⇒ ElideCircumfix
Returns a new instance of ElideCircumfix.
191 192 193 194 |
# File 'lib/hx/path.rb', line 191 def initialize(selector, prefix, suffix) @selector = selector @circumfix_re = Path.make_circumfix_re(prefix, suffix) end |
Class Method Details
.build(selector, prefix, suffix) ⇒ Object
187 188 189 |
# File 'lib/hx/path.rb', line 187 def self.build(selector, prefix, suffix) new(selector, prefix, suffix) end |
Instance Method Details
#accept_path?(path) ⇒ Boolean
196 197 198 |
# File 'lib/hx/path.rb', line 196 def accept_path?(path) !!(path =~ @circumfix_re and @selector.accept_path?($1)) end |