|
|
|
|
|
by 10char
4782 days ago
|
|
What jballanc is saying is that yes these things are possible in Objective-C, but the technique of doing these tricks in Ruby/Motion is an order of magnitude simpler and idiomatic: klass = Object.const_set "MySubclass", Class.new(Object)
klass.send(:attr_accessor, :foo)
klass.send(:define_method, "description") {
"<#{self.class}: foo=#{self.foo}>"
}
|
|