y_support 2.0.24 → 2.0.25

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d8afafc604de2cef2f7c7e22e744db08f5472efe
4
- data.tar.gz: 8fbfc61eec9b5dd2f323f7d6d27123146bffe66b
3
+ metadata.gz: 0561e18c5b606a92e92f8ebfe01b3e350ad8feab
4
+ data.tar.gz: 05822896871dba52532fb86bb1260c294c834076
5
5
  SHA512:
6
- metadata.gz: d712d8892d2a4691bc6226591022aac9c5140d1251b8aa85d7cd03ab0603a0d163b04771c2d90d413e85c74123f5790f96ca781dc1131b1f14e23206b2868c64
7
- data.tar.gz: b4a40eb0127ceed35b879a3fb04944f68e315cb0623a45c1e185bec8acab5e37c41b9c592cbb0b3d38488065bd2bc337b7613f9fcb01f161046cbf66e632000a
6
+ metadata.gz: 6accb0f8a63e501963efbe7abeb5eca5c5674e9138e84e8e28c98ec12959680595d40763da3a3ec69a62a8e74422969a42ff2f03811d3ea871192cee87bb225b
7
+ data.tar.gz: 5aaefcb56b0efa60fd847d28649c8b893d6af7919fdf7dc98e51957d534f5b7c560c7d1f7bef61de5d2b9bb00239bb65856a61335795b88573f82e5e53633e45
@@ -14,11 +14,12 @@ class Object
14
14
  }
15
15
  end
16
16
 
17
- # Expects a hash of pairs { name: class }, and a hash of parameters. Creates
18
- # subclasses parametrized with the supplied parameters as the object attributes
19
- # and makes them accessible under the supplied names (as reader methods).
17
+ # Makes the receiver own parametrized subclasses of the supplied classes.
18
+ # Expects a hash of pairs { reader_symbol: class }, and a hash of parameters,
19
+ # with which the class(es) is (are) parametrized. Parametrized subclasses
20
+ # are made accessible under the supplied reader symbol.
20
21
  #
21
- def parametrizes hash, with: (fail ArgumentError, "No parameters!")
22
+ def param_class hash, with: (fail ArgumentError, "No parameters!")
22
23
  hash.each { |ß, ç| set_attr_with_readers ß => ç.parametrize( **with ) }
23
24
  return nil
24
25
  end
@@ -1,3 +1,3 @@
1
1
  module YSupport
2
- VERSION = "2.0.24"
2
+ VERSION = "2.0.25"
3
3
  end
data/test/misc_test.rb CHANGED
@@ -9,9 +9,9 @@ describe Object do
9
9
  require 'y_support/core_ext/object'
10
10
  end
11
11
 
12
- it "should have #parametrizes" do
12
+ it "should have #param_class" do
13
13
  o = Object.new
14
- o.parametrizes( { Array: Array, foo: Hash }, with: { mother: o } )
14
+ o.param_class( { Array: Array, foo: Hash }, with: { mother: o } )
15
15
  assert o.Array < Array
16
16
  o.Array.mother.must_equal( o )
17
17
  o.foo.mother.must_equal( o )
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: y_support
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.24
4
+ version: 2.0.25
5
5
  platform: ruby
6
6
  authors:
7
7
  - boris