named-parameters 0.0.3 → 0.0.4

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.md CHANGED
@@ -66,6 +66,22 @@ a parameter named `timeout` - so the following invocations will not raise error:
66
66
  But specifying an unrecognized parameter will do:
67
67
 
68
68
  gs.request '/some/path', :ssl => true # ArgumentError, GoogleStorage#request unrecognized parameter: ssl
69
+
70
+ The `has_named_parameters` declaration may be used for either class or
71
+ instance methods of a class:
72
+
73
+ class Point
74
+ has_named_parameters :initialize, :required => [ :x, :y ], :optional => :color
75
+ def initialize opts = { }
76
+ # ...
77
+ end
78
+
79
+ has_named_parameters :load, :optional => :translations
80
+ def self.load filename, opts => { }
81
+ # ...
82
+ end
83
+ end
84
+
69
85
 
70
86
  Optional and Required Parameters
71
87
  --------------------------------
data/RELEASENOTES CHANGED
@@ -1,3 +1,7 @@
1
+ 0.0.4 [Nov 11, 2010]
2
+ --------------------
3
+ - [BUGFIX] Reported method name when ArgumentError is raised was ugly.
4
+
1
5
  0.0.3 [Nov 11, 2010]
2
6
  --------------------
3
7
  - Added support for has_named_parameter declaration for class methods.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.3
1
+ 0.0.4
@@ -91,7 +91,7 @@ module NamedParameters
91
91
  instrument name do
92
92
  method = self.eigenclass.instance_method name
93
93
  spec = specs.delete name
94
- owner = "#{self.name}."
94
+ owner = "#{self.name}::"
95
95
  eigenclass.instance_eval do
96
96
  intercept method, owner, name, spec
97
97
  end
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{named-parameters}
8
- s.version = "0.0.3"
8
+ s.version = "0.0.4"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Juris Galang"]
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: named-parameters
3
3
  version: !ruby/object:Gem::Version
4
- hash: 25
4
+ hash: 23
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 3
10
- version: 0.0.3
9
+ - 4
10
+ version: 0.0.4
11
11
  platform: ruby
12
12
  authors:
13
13
  - Juris Galang