README.md in mpatch-2.9.0 vs README.md in mpatch-2.11.0
- old
+ new
@@ -19,30 +19,44 @@
```
### example with Class methods
```ruby
+
require 'mpatch'
- class Test
+ class Test2
+ @@test= "asd"
+ end
+ class Test < Test2
+
def initialize
@hello= "world"
- @sup= "nothing"
+ @no = "yes"
end
end
- puts Test.new.convert_to_hash
- #> {"hello" => "world", "sup" => "nothing"}
+ puts Test2.inherited_by.inspect
+ # [Test]
+
+ puts Test.conv2hash
+ # {"test"=>"asd"}
+
+ puts Test.new.conv2hash
+ # {"hello"=>"world", "no"=>"yes"}
+
+
```
The module give you tools in your hand for inheritance handle.
For example:
```ruby
+
puts Models::MongoidClassName.mixin_ancestors.include? Mongoid::Document
#> true
puts Mongoid::Document.inherited_by.inspect
#> [MongoidClassName]