lib/materialist/materializer/internals/dsl.rb in materialist-3.5.0 vs lib/materialist/materializer/internals/dsl.rb in materialist-3.6.0

- old
+ new

@@ -4,11 +4,15 @@ module DSL def materialize_link(key, topic: key) __materialist_options[:links_to_materialize][key] = { topic: topic } end - def capture(key, as: key) - __materialist_dsl_mapping_stack.last << FieldMapping.new(key: key, as: as) + def capture(key, as: key, &value_parser_block) + __materialist_dsl_mapping_stack.last << FieldMapping.new( + key: key, + as: as, + value_parser: value_parser_block + ) end def capture_link_href(key, as:, &url_parser_block) __materialist_dsl_mapping_stack.last << LinkHrefMapping.new( key: key,