How to monitor an Array's change?

  • Thread starter Magicloud Magiclouds
  • Start date
M

Magicloud Magiclouds

Hello,
Array under .net has some event on content changing. How to do monitor
like this in ruby?

Thanks.
 
P

Paul Stickney

You could proxy (via a true proxy or singletons or whatnot) for MOST operations.
 
C

Clifford Heath

Magicloud said:
Array under .net has some event on content changing. How to do monitor
like this in ruby?

gem install chattr

allows you to define an array class having a type-checking
function that contains the hook you want. You can probably
ven replace the regular Array class with your new one. In
any case, all the mutating methods of Array make their calls
through the type-check block, so you have what you need.

Clifford Heath.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,276
Messages
2,571,384
Members
48,072
Latest member
FaustoBust

Latest Threads

Top