y_support 2.0.25 → 2.0.26
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/y_support/core_ext/class/misc.rb +1 -1
- data/lib/y_support/core_ext/object/misc.rb +6 -3
- data/lib/y_support/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5e6a058c7448c3b6509f06094c0a87e0c461f76a
|
4
|
+
data.tar.gz: a762394265c6944cee3c03c425db229be6413461
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3b573bdc654d513ea128b8365b55673635de52bea8c70d0a98430f907efb661693dfb1a92fc05025b76cdc98d9c476d011f514f97be58a28d586837632305a9d
|
7
|
+
data.tar.gz: 19f94cca7c6ca5920209c1565c09ccaba9d5d910699144016780e1fdd61131b531ecef00608d5e9c985779675c0c3f937b52b5c084ff762dde22d0c1a50dda52
|
@@ -6,7 +6,7 @@ class Class
|
|
6
6
|
# singleton method(s) named "symbol" be defined on the subclass, returning
|
7
7
|
# "value".
|
8
8
|
#
|
9
|
-
def parametrize
|
9
|
+
def parametrize parameters
|
10
10
|
Class.new( self ).tap do |subclass|
|
11
11
|
parameters.each_pair { |symbol, value|
|
12
12
|
subclass.define_singleton_method symbol do value end
|
@@ -5,11 +5,11 @@ class Object
|
|
5
5
|
# getter (reader) methods. Optional argument +:overwrite_methods+ enables the
|
6
6
|
# readers to overwrite existing methods.
|
7
7
|
#
|
8
|
-
def set_attr_with_readers(
|
8
|
+
def set_attr_with_readers( hash )
|
9
9
|
hash.each_pair { |symbol, value|
|
10
10
|
instance_variable_set "@#{symbol}", value
|
11
11
|
fail NameError, "Method \##{symbol} already defined!" if
|
12
|
-
methods.include? symbol unless overwrite_methods == true
|
12
|
+
methods.include? symbol unless hash[:overwrite_methods] == true
|
13
13
|
singleton_class.class_exec { attr_reader symbol }
|
14
14
|
}
|
15
15
|
end
|
@@ -20,7 +20,10 @@ class Object
|
|
20
20
|
# are made accessible under the supplied reader symbol.
|
21
21
|
#
|
22
22
|
def param_class hash, with: (fail ArgumentError, "No parameters!")
|
23
|
-
hash.each { |ß, ç|
|
23
|
+
hash.each { |ß, ç|
|
24
|
+
sub = ç.parametrize with
|
25
|
+
set_attr_with_readers( ß => sub )
|
26
|
+
}
|
24
27
|
return nil
|
25
28
|
end
|
26
29
|
end
|
data/lib/y_support/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: y_support
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.26
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- boris
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-07-
|
11
|
+
date: 2013-07-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|