Module: Enumpath
- Defined in:
- lib/enumpath.rb,
lib/enumpath/path.rb,
lib/enumpath/logger.rb,
lib/enumpath/results.rb,
lib/enumpath/version.rb,
lib/enumpath/operator.rb,
lib/enumpath/operator/base.rb,
lib/enumpath/operator/child.rb,
lib/enumpath/operator/slice.rb,
lib/enumpath/operator/union.rb,
lib/enumpath/resolver/simple.rb,
lib/enumpath/operator/wildcard.rb,
lib/enumpath/resolver/property.rb,
lib/enumpath/path/normalized_path.rb,
lib/enumpath/operator/filter_expression.rb,
lib/enumpath/operator/recursive_descent.rb,
lib/enumpath/operator/subscript_expression.rb
Overview
TODO: Investigate supporting anchored paths ($.foo.bar...
, @.foo.bar...
)
Defined Under Namespace
Modules: Operator, Resolver Classes: Path, Results
Constant Summary collapse
- VERSION =
'0.1.2'
Class Attribute Summary collapse
-
.verbose ⇒ true, false
Whether verbose mode is enabled.
Class Method Summary collapse
-
.apply(path, enum, options = {}) ⇒ Enumpath::Results
Resolve a path expression against an enumerable.
Class Attribute Details
.verbose ⇒ true, false
Whether verbose mode is enabled. When enabled, the Logger will print information to the logging stream to assist in debugging path expressions. Defaults to false
22 23 24 |
# File 'lib/enumpath.rb', line 22 def verbose @verbose end |
Class Method Details
.apply(path, enum, options = {}) ⇒ Enumpath::Results
Resolve a path expression against an enumerable
32 33 34 35 36 |
# File 'lib/enumpath.rb', line 32 def apply(path, enum, = {}) logger.level = 0 @verbose = .delete(:verbose) || false Enumpath::Path.new(path, result_type: .delete(:result_type)).apply(enum) end |