named-parameters 0.0.16 → 0.0.17

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,3 +1,7 @@
1
+ 0.0.17 [Dec 7, 2010]
2
+ - [BUGFIX] filter_parameters method wasn't computing the correct context for
3
+ its caller.
4
+
1
5
  0.0.16 [Dec 6, 2010]
2
6
  - Added bundler in the gemspec (leftover from previous version bump)
3
7
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.16
1
+ 0.0.17
@@ -51,7 +51,7 @@ module NamedParameters
51
51
  caller = calling_method
52
52
  self.instance_of?(Class) ? :"self.#{caller}" : caller
53
53
  end
54
-
54
+
55
55
  return [] unless spec = specs[klazz.send(:key_for, method)]
56
56
 
57
57
  mapper = lambda{ |entry| entry.instance_of?(Hash) ? entry.keys.first : entry }
@@ -113,10 +113,11 @@ module NamedParameters
113
113
  #
114
114
  def filter_parameters options, filter = nil
115
115
  caller = calling_method
116
- filter ||= declared_parameters{ caller }
116
+ method = self.instance_of?(Class) ? :"self.#{caller}" : caller
117
+ filter ||= declared_parameters { method }
117
118
  options.reject{ |key, value| !filter.include?(key) }
118
119
  end
119
-
120
+
120
121
  protected
121
122
  def self.included base # :nodoc:
122
123
  base.extend ClassMethods
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{named-parameters}
8
- s.version = "0.0.16"
8
+ s.version = "0.0.17"
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"]
12
- s.date = %q{2010-12-06}
12
+ s.date = %q{2010-12-07}
13
13
  s.description = %q{This gem simulates named-parameters in Ruby.
14
14
  It's a complement to the common Ruby idiom of using Hash args to emulate
15
15
  the use of named parameters. }
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 0
8
- - 16
9
- version: 0.0.16
8
+ - 17
9
+ version: 0.0.17
10
10
  platform: ruby
11
11
  authors:
12
12
  - Juris Galang
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2010-12-06 00:00:00 -08:00
17
+ date: 2010-12-07 00:00:00 -08:00
18
18
  default_executable:
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
@@ -128,7 +128,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
128
128
  requirements:
129
129
  - - ">="
130
130
  - !ruby/object:Gem::Version
131
- hash: -811416074208594537
131
+ hash: 3220256542107375032
132
132
  segments:
133
133
  - 0
134
134
  version: "0"