refinement_builder 1.0.4 → 1.0.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +9 -8
  3. data/lib/version.rb +1 -1
  4. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4f4e1c703de3929a7931cf40c14429221fe73e94
4
- data.tar.gz: bbc24d88666723e817976b61a7ac5ad846e1954b
3
+ metadata.gz: 6b1afc5db20e67a31004c14df6c7d46fa513ec3e
4
+ data.tar.gz: b17aa0341839cc1303d5ccb2192e0cb828944efe
5
5
  SHA512:
6
- metadata.gz: 8a7d9a3d83c211142a68911b6de2ac66ad97e795c0a6bd663a18be1030ec784928776328c156480e007a59a9973ad383923a833e548a8dbdfa0c3fc4d5c9275d
7
- data.tar.gz: 2af505373a3c470c5c1b1398a0a754bfeec8accceca4d21e08e34d4e112a7a34040601700c28e4a24adca130194213ffeae2290150e8bd712dbc18739c9a6350
6
+ metadata.gz: 558d64403438f94d150a1b1405779746d931002899f69a9a4bbe06837cb197e1d0cabac6c90dd3f6eb212e152385fdb19d3120f60f3868efcad58baa0ade7d74
7
+ data.tar.gz: 7e6f3cbb1b5a79244b046416f93a72651fee68b6e538d6fb3f723bee3c0265d90f1446578c5dba4caa802011316d2c6c468deacd8c5b3fbca79e0a3f74d6173d
data/README.md CHANGED
@@ -76,14 +76,6 @@ The `StringPatch` has its methods accessible in the same 3 ways as `RefinementBu
76
76
  "hello world".print_first_5_characters
77
77
  # => hello
78
78
 
79
- ## Under the hood
80
- Under the hood, what happens is this:
81
-
82
- 1. A module is defined with the given name and instance method definitions
83
- 2. Each of the instance methods is overwritten in such a way that it will delegate to the class method if called from any other scope, and execute the original function body if it's in class method scope.
84
- 3. The instance methods are copied to class methods via `module_function`
85
- 3. A refinement is defined with the instance methods.
86
-
87
79
  ## Usage 4 - _options_
88
80
 
89
81
  `refinement_builder` only cares about three arguments (and the block):
@@ -94,6 +86,15 @@ Under the hood, what happens is this:
94
86
  1. `namespace: <class/module>` where the module will be created under (defaults to Object)
95
87
  2. `refines: <class>` what the refinement will patch. Also defaults to Object.
96
88
 
89
+ ## Under the hood
90
+ Under the hood, what happens is this:
91
+
92
+ 1. A module is defined with the given name and instance method definitions
93
+ 2. Each of the instance methods is overwritten in such a way that it will delegate to the class method if called from any other scope, and execute the original function body if it's in class method scope.
94
+ 3. The instance methods are copied to class methods via `module_function`
95
+ 3. A refinement is defined with the instance methods.
96
+
97
+
97
98
  ## Benefits of this approach
98
99
 
99
100
  The main benefit is the ability to get these multiple usages without writing wrapper functions. Here's a module definition which is about the same as the one created by this factory:
data/lib/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module RefinementBuilder
2
- VERSION = '1.0.4'
2
+ VERSION = '1.0.5'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: refinement_builder
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.4
4
+ version: 1.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - max pleaner