Class: Omnis::MonadicNestedHashExtractor
- Inherits:
-
NestedHashExtractor
- Object
- NestedHashExtractor
- Omnis::MonadicNestedHashExtractor
- Defined in:
- lib/omnis/monadic_nested_hash_extractor.rb
Instance Method Summary collapse
Instance Method Details
#extractor(path) ⇒ Object
5 6 7 8 9 |
# File 'lib/omnis/monadic_nested_hash_extractor.rb', line 5 def extractor(path) raise ArgumentError("path to extract must be a string") unless String === path expr = "source#{from_dot_path(path)} rescue Nothing" ->source { Maybe(eval(expr)) } end |