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.
- data/lib/acts_as_chain.rb +5 -1
- data/lib/acts_as_chain/version.rb +1 -1
- data/spec/acts_as_chain_spec.rb +4 -0
- metadata +2 -2
data/lib/acts_as_chain.rb
CHANGED
@@ -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
|
-
|
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
|
data/spec/acts_as_chain_spec.rb
CHANGED
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
|
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-
|
13
|
+
date: 2011-12-18 00:00:00 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: rspec
|