Sha256: c79b8e8560ce911b81f68c2200abad16a38c940bcdd73c61f96fa80b23de77b0
Contents?: true
Size: 503 Bytes
Versions: 14
Compression:
Stored size: 503 Bytes
Contents
# frozen_string_literal: true module Grumlin class Shortcut extend Forwardable attr_reader :name, :block def_delegator :@block, :arity def_delegator :@block, :source_location def initialize(name, &block) @name = name @block = block end def ==(other) @name == other.name && @block == other.block end # TODO: to_s, inspect, preview def apply(object, *args, **params) object.instance_exec(*args, **params, &@block) end end end
Version data entries
14 entries across 14 versions & 1 rubygems