Sha256: b074d3ac521fd7de325e9c5cd46e484cc376d9aa1f763643e92afa3f1b3aff6e
Contents?: true
Size: 509 Bytes
Versions: 10
Compression:
Stored size: 509 Bytes
Contents
require 'jactive_support/core_ext/module' class Base def self.inherited(other) other.instance_variable_set('@thename', other.name || '') end end Test2 = Class.new(Base) describe Module, 'define_class' do it "normal dynamic class does not have access to name in inherited" do Test2.instance_variable_get('@thename').should eq('') end it "should have access to name even in inherited" do Object.define_class('Test', Base).instance_variable_get('@thename').should eq('Test') end end
Version data entries
10 entries across 10 versions & 1 rubygems