Type:
Module
mutex_m.rb
When 'mutex_m' is required, any object that extends or includes Mutex_m will be treated like a Mutex.
Start by requiring the standard library Mutex_m:
1 | require "mutex_m.rb" |
From here you can extend an object with Mutex instance methods:
1 2 | obj = Object . new obj.extend Mutex_m |
Or mixin Mutex_m into your module to your class inherit Mutex instance methods.
1 2 3 4 5 6 | class Foo include Mutex_m # ... end obj = Foo. new # this obj can be handled like Mutex |