Module: AspectR::Aspect::AspectSupport::InstanceSupport
- Defined in:
- lib/aspectr.rb
Instance Method Summary collapse
- #__aop_alias(new, old, private = true) ⇒ Object
- #__aop_class ⇒ Object
- #__aop_eval(text) ⇒ Object
- #__aop_mangle(method) ⇒ Object
- #__aop_private_methods ⇒ Object
- #__aop_target ⇒ Object
Instance Method Details
#__aop_alias(new, old, private = true) ⇒ Object
264 265 266 267 268 269 270 271 272 273 274 275 276 |
# File 'lib/aspectr.rb', line 264 def __aop_alias(new, old, private = true) # Install in class since otherwise the non-dispatcher version of the class version of the method # gets locked away, and so if we wrap a singleton before wrapping its class, # later wrapping the class has no effect on that singleton /AB # of course, this depends on exactly what behavior we want for inheritance... Decide for future release... unless self.class.respond_to?("__aop_init") self.class.extend AspectSupport self.class.__aop_init end self.class.__aop_install_dispatcher(old) eval "class << self; alias_method '#{new}', '#{old}'; end;" eval "class << self; private '#{new}'; end" if private end |
#__aop_class ⇒ Object
256 257 258 |
# File 'lib/aspectr.rb', line 256 def __aop_class self.class end |
#__aop_eval(text) ⇒ Object
282 283 284 |
# File 'lib/aspectr.rb', line 282 def __aop_eval(text) instance_eval text end |
#__aop_mangle(method) ⇒ Object
260 261 262 |
# File 'lib/aspectr.rb', line 260 def __aop_mangle(method) "__aop__singleton_#{method}" end |
#__aop_private_methods ⇒ Object
278 279 280 |
# File 'lib/aspectr.rb', line 278 def __aop_private_methods private_methods end |
#__aop_target ⇒ Object
252 253 254 |
# File 'lib/aspectr.rb', line 252 def __aop_target "self" end |