Module: RubyInterface

Defined in:
lib/ruby_interface.rb,
lib/ruby_interface/version.rb

Defined Under Namespace

Modules: ClassMethods

Constant Summary collapse

VERSION =
'0.3.1'

Class Method Summary collapse

Class Method Details

.included(klass) ⇒ Object



5
6
7
8
9
10
11
12
13
14
15
16
# File 'lib/ruby_interface.rb', line 5

def self.included(klass)
  klass.extend ClassMethods

  klass.class_eval do
    singleton_class.send(:alias_method, :_old_inherited, :inherited) if respond_to?(:inherited)
  end

  def klass.inherited(child)
    child.name.nil? ? anonymous_class_definition(child) : named_class_definition(child)
    _old_inherited(child) if respond_to?(:_old_inherited)
  end
end