acts_as_chain 1.0.1 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -6,10 +6,14 @@ class Object
6
6
  define_method method do |*args|
7
7
  if args.empty?
8
8
  instance_variable_get("@#{method.to_s}")
9
- else
9
+ elsif args.one?
10
10
  tap {
11
11
  instance_variable_set("@#{method.to_s}", args.first)
12
12
  }
13
+ else
14
+ tap {
15
+ instance_variable_set("@#{method.to_s}", args)
16
+ }
13
17
  end
14
18
  end
15
19
  end
@@ -1,3 +1,3 @@
1
1
  module ActsAsChain
2
- VERSION = "1.0.1"
2
+ VERSION = "1.1.0"
3
3
  end
@@ -20,4 +20,8 @@ describe ActsAsChain do
20
20
  object.fake1.should eq("one")
21
21
  object.fake2.should eq("two")
22
22
  end
23
+
24
+ it "should be able to handle multiply arguments" do
25
+ object.fake1("one", "two").fake1.should eq(["one", "two"])
26
+ end
23
27
  end
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: acts_as_chain
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 1.0.1
5
+ version: 1.1.0
6
6
  platform: ruby
7
7
  authors:
8
8
  - Linus Oleander
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2011-10-22 00:00:00 Z
13
+ date: 2011-12-18 00:00:00 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rspec