rogerdpack-arguments 0.4.7.3 → 0.4.7.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.
@@ -1,4 +1,4 @@
1
- class Class
1
+ module NamedArgs
2
2
  def named_arguments_for *methods
3
3
  methods = instance_methods - Object.methods if methods.empty?
4
4
 
@@ -46,3 +46,6 @@ class Class
46
46
  alias :named_args :named_arguments_for
47
47
 
48
48
  end
49
+
50
+ class Class; include NamedArgs; end
51
+ class Module; include NamedArgs; end
@@ -6,6 +6,7 @@ describe Arguments do
6
6
  before do
7
7
  Object.send(:remove_const, 'Klass') rescue nil
8
8
  load "#{ File.dirname __FILE__ }/klass.rb"
9
+ load "#{ File.dirname __FILE__ }/module.rb"
9
10
  @instance = Klass.new
10
11
  end
11
12
 
@@ -109,7 +110,8 @@ describe Arguments do
109
110
  end
110
111
 
111
112
  it "should work with modules too" do
112
- lambda { module TestMod; def go(a); end; named_arguments_for :go; end }
113
+ TestMod.send( :named_arguments_for, :go)
114
+ IncludesTestMod.new.go(:a => 1).should == 1
113
115
  end
114
116
 
115
117
  it "should benchmark with hack" do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rogerdpack-arguments
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.7.3
4
+ version: 0.4.7.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Macario Ortega