Sha256: 628b1b8076f2b44f82597430d3250e66bee8df995b5caa36cecedca61b1fbb28
Contents?: true
Size: 651 Bytes
Versions: 12
Compression:
Stored size: 651 Bytes
Contents
module ATP module Processors # Makes the AST safe for Marshaling class Marshal < Processor def on_object(node) o = node.value if o.is_a?(String) node.updated(nil, [{ 'Test' => o }]) elsif o.is_a?(Hash) node.updated(nil, [o]) elsif o.respond_to?(:to_meta) && o.to_meta && !o.to_meta.empty? node.updated(nil, [o.to_meta]) else meta = { 'Test' => o.name } meta['Pattern'] = o.try(:pattern) node.updated(nil, [meta]) end end def on_render(node) node.updated(nil, [node.value.to_s]) end end end end
Version data entries
12 entries across 12 versions & 1 rubygems