Class: Mantra::Manifest::Scope::HashScope
- Inherits:
-
Mantra::Manifest::Scope
- Object
- Mantra::Manifest::Scope
- Mantra::Manifest::Scope::HashScope
- Defined in:
- lib/mantra/manifest/scope/hash_scope.rb
Constant Summary
Constants inherited from Mantra::Manifest::Scope
ARRAY_SELECTOR_REGEXP, HASH_SELECTOR_REGEXP
Instance Attribute Summary
Attributes inherited from Mantra::Manifest::Scope
Instance Method Summary collapse
-
#_filter(element) ⇒ Object
returns array of children that matches this scope.
Methods inherited from Mantra::Manifest::Scope
#filter, #has_same_type?, #initialize, #last?, #match?, parse, parse_selector, raise_parse_error, split_selector, #to_a
Methods included from Helpers::RegexpHelper
Methods included from Helpers::ObjectWithType
Constructor Details
This class inherits a constructor from Mantra::Manifest::Scope
Instance Method Details
#_filter(element) ⇒ Object
returns array of children that matches this scope
9 10 11 12 13 14 15 |
# File 'lib/mantra/manifest/scope/hash_scope.rb', line 9 def _filter(element) scope_regexp = to_regexp(scope) element.content.each_pair.map do |pair| key, value = *pair key.match(scope_regexp) ? value : nil end.compact end |