Sha256: 0983f649f23f236e60118bbb8bf197798f62a420f7316b044ecf125062b42884
Contents?: true
Size: 345 Bytes
Versions: 21
Compression:
Stored size: 345 Bytes
Contents
module Johnson module Visitors class EnumeratingVisitor < Visitor attr_accessor :block def initialize(block) @block = block end superclass.instance_methods.each do |method| next unless method.to_s =~ /^visit_/ eval("def #{method}(o); block.call(o); super; end") end end end end
Version data entries
21 entries across 21 versions & 5 rubygems