Sha256: 66e96201565acd0de4554ee9faa9f1e48c3a043d18accbad084fd516221447e2

Contents?: true

Size: 358 Bytes

Versions: 10

Compression:

Stored size: 358 Bytes

Contents

require 'facets/kernel/meta_class'

module Kernel

  # Evaluate code in a metaclass. This is equivalent to:
  #
  #   meta_class.instance_eval(...)
  #
  # CREDIT: WhyTheLuckyStiff

  def meta_eval(str=nil, *file_and_line, &blk)
    if str
      meta_class.instance_eval(str, *file_and_line)
    else
      meta_class.instance_eval(&blk)
    end
  end

end

Version data entries

10 entries across 9 versions & 2 rubygems

Version Path
facets-glimmer-3.2.0 lib/core/facets/kernel/meta_eval.rb
facets-3.1.0 lib/core/facets/kernel/meta_eval.rb
facets-3.0.0 lib/core/facets/kernel/meta_eval.rb
facets-2.9.3 lib/core/facets/kernel/meta_eval.rb
facets-2.9.2 src/core/facets/kernel/meta_eval.rb
facets-2.9.2 lib/core/facets/kernel/meta_eval.rb
facets-2.9.1 lib/core/facets/kernel/meta_eval.rb
facets-2.9.0 lib/core/facets/kernel/meta_eval.rb
facets-2.9.0.pre.2 lib/core/facets/kernel/meta_eval.rb
facets-2.9.0.pre.1 lib/core/facets/kernel/meta_eval.rb