Sha256: f4ca46331af47e2523810d24d05f2d4a0884f54f55c4a945ccb7749db78d2316
Contents?: true
Size: 607 Bytes
Versions: 10
Compression:
Stored size: 607 Bytes
Contents
module XFTP # Contains helper classes and modules to simplify building a DSL module DSL # Gives the target class an ability to expose both DSL design patterns. # It yields self as a block argument if arity of the given block takes exactly 1 argument, otherwise # it simply evaluates the given block of the target class instance (see BasicObject#instance_eval) module BlockEvaluator def evaluate(&callback) return unless block_given? if callback.arity == 1 yield self else instance_eval(&callback) end end end end end
Version data entries
10 entries across 10 versions & 1 rubygems