Sha256: cb76f1ea52e2db27777211b91b0cba39f85a9d8e76f9986ccd268a5eceefa6cf

Contents?: true

Size: 206 Bytes

Versions: 12

Compression:

Stored size: 206 Bytes

Contents

module Kernel
  def eval_or_yield obj, &block
    if block_given?
      if block.arity < 1
        obj.instance_eval(&block)
      else
        block.call(obj)
      end
    else
      obj
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
confstruct-1.1.0 lib/confstruct/utils.rb
confstruct-1.0.2 lib/confstruct/utils.rb
confstruct-1.0.1 lib/confstruct/utils.rb
confstruct-0.2.7 lib/confstruct/utils.rb
confstruct-0.2.6 lib/confstruct/utils.rb
confstruct-0.2.5 lib/confstruct/utils.rb
confstruct-0.2.4 lib/confstruct/utils.rb
confstruct-0.2.3 lib/confstruct/utils.rb
confstruct-0.2.2 lib/confstruct/utils.rb
confstruct-0.2.1 lib/confstruct/utils.rb
confstruct-0.2.0 lib/confstruct/utils.rb
confstruct-0.1.0 lib/confstruct/utils.rb