Class: MetaDef::ClassDef
- Inherits:
-
Object
- Object
- MetaDef::ClassDef
- Defined in:
- lib/metadef/meta_def.rb
Instance Attribute Summary collapse
-
#real_class ⇒ Object
readonly
Returns the value of attribute real_class.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(real_class) ⇒ ClassDef
constructor
A new instance of ClassDef.
- #method(name, &block) ⇒ Object
Constructor Details
#initialize(real_class) ⇒ ClassDef
Returns a new instance of ClassDef.
47 48 49 |
# File 'lib/metadef/meta_def.rb', line 47 def initialize(real_class) @real_class = real_class end |
Instance Attribute Details
#real_class ⇒ Object (readonly)
Returns the value of attribute real_class.
45 46 47 |
# File 'lib/metadef/meta_def.rb', line 45 def real_class @real_class end |
Class Method Details
.build(obj) ⇒ Object
51 52 53 |
# File 'lib/metadef/meta_def.rb', line 51 def self.build(obj) new obj.class end |
Instance Method Details
#method(name, &block) ⇒ Object
55 56 57 |
# File 'lib/metadef/meta_def.rb', line 55 def method(name, &block) real_class.send :define_method, name, block end |