Sha256: 47f76524a7d4e91c8e85391f38ccbc8d06d3bcb206c5c6ad54989fd24aa17858
Contents?: true
Size: 469 Bytes
Versions: 11
Compression:
Stored size: 469 Bytes
Contents
# frozen_string_literal: true module RuboCop # Similar to `Forwardable#def_delegators`, but simpler & faster module SimpleForwardable def def_delegators(accessor, *methods) methods.each do |method| class_eval(<<~RUBY, __FILE__, __LINE__ + 1) def #{method}(...) # def example(...) #{accessor}.#{method}(...) # foo.example(...) end # end RUBY end end end end
Version data entries
11 entries across 11 versions & 1 rubygems