M
Mike Austin
'some_object.class.to_s' doesn't work because it returns the entire hierarchy,
i.e 'SomeModule::SomeClass'. I could do some string ops on that but it seems
there would be an easier way. Here's an example:
class MenuStyle
class Button < Style
end
end
class View
def initialize()
@delegate = MenuStyle.const_get( self.class.to_s )
end
end
Thanks,
Mike
i.e 'SomeModule::SomeClass'. I could do some string ops on that but it seems
there would be an easier way. Here's an example:
class MenuStyle
class Button < Style
end
end
class View
def initialize()
@delegate = MenuStyle.const_get( self.class.to_s )
end
end
Thanks,
Mike