named_parameters 1.0.0 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/README +1 -0
- data/lib/named_parameters.rb +4 -2
- metadata +1 -1
data/README
CHANGED
@@ -136,6 +136,7 @@ Kudos to Juris Galang and his gem named-parameters. (http://www.rubygems.org/gem
|
|
136
136
|
Defenitely have a look at this gem also, if you want to use named parameters.
|
137
137
|
|
138
138
|
== Changelog
|
139
|
+
[1.0.1] * Removed unimportant methods from documentation
|
139
140
|
[1.0.0] * Added strict and super modes
|
140
141
|
* Smoother implementation
|
141
142
|
* Better structured code
|
data/lib/named_parameters.rb
CHANGED
@@ -4,6 +4,7 @@
|
|
4
4
|
module NamedParameters
|
5
5
|
|
6
6
|
# Makes all methods of this module to class or module methods of include
|
7
|
+
# @private
|
7
8
|
def self.included base #:nodoc:
|
8
9
|
base.extend(self)
|
9
10
|
end
|
@@ -14,6 +15,7 @@ module NamedParameters
|
|
14
15
|
private :method_added_before_named_parameters
|
15
16
|
end
|
16
17
|
|
18
|
+
# @private
|
17
19
|
def method_added(method_name)
|
18
20
|
# redefine the method
|
19
21
|
if @redefine_next
|
@@ -43,7 +45,7 @@ module NamedParameters
|
|
43
45
|
end
|
44
46
|
|
45
47
|
# Makes the next method callable via named parameters (options hash) and calls super with this options hash as the
|
46
|
-
#
|
48
|
+
# only parameter
|
47
49
|
# The caller hash may contain keys that are not contained in the parameters of the next method
|
48
50
|
# @param [Hash[Symbol,Object]] optionals Optional default values for the parameters
|
49
51
|
def named_parameters_super(optionals = { })
|
@@ -51,7 +53,7 @@ module NamedParameters
|
|
51
53
|
end
|
52
54
|
|
53
55
|
# Makes the next method callable via named parameters (options hash) and calls super with this options hash as the
|
54
|
-
#
|
56
|
+
# only parameter
|
55
57
|
# The caller hash may only contain keys that are in the parameters of the next method
|
56
58
|
# @param [Hash[Symbol,Object]] optionals Optional default values for the parameters
|
57
59
|
def named_parameters_strict_super(optionals = { })
|