Class: Object

Inherits:
BasicObject
Defined in:
opal/fron/core_ext/object.rb

Overview

Instance Method Summary collapse

Instance Method Details

#meta_def(name, &blk) ⇒ Object

Defines a class method

Parameters:

  • name (String)

    The name of the method

  • blk (Block)

    The body of the method



8
9
10
# File 'opal/fron/core_ext/object.rb', line 8

def meta_def(name, &blk)
  (class << self; self; end).instance_eval { define_method name, &blk }
end