atacama 0.1.5 → 0.1.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +3 -0
- data/lib/atacama/contract.rb +2 -2
- data/lib/atacama/transaction.rb +5 -3
- data/lib/atacama/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5cf86d5c337258aa67e7c9f25dfe42a0bc82a913
|
4
|
+
data.tar.gz: a1f304895a629d1c13c9455536e853acd1e5371e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 78d72f1ee206d6b4f253531eef2ec3e1a4ad93c572fdbde98887ba74267542e269ef9c534a9d1fc2853a5ffe9148242002583aa0bca863d61d0a3a12b7ec6e1b
|
7
|
+
data.tar.gz: 5f2b0f9530c7b675930af229cd5577ffdf24c6addc3443c7db277fb1b0a3a3731ec7d95c7f1f509fce8aa7eac92d3cab5479ea46a517fdc66080264b43226fbb
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
data/lib/atacama/contract.rb
CHANGED
@@ -50,8 +50,8 @@ module Atacama
|
|
50
50
|
define_method("#{name}?") { !!@context[name] }
|
51
51
|
end
|
52
52
|
|
53
|
-
def call(context = {})
|
54
|
-
new(context: context).call.tap do |result|
|
53
|
+
def call(context = {}, &block)
|
54
|
+
new(context: context).call(&block).tap do |result|
|
55
55
|
validate_return(result)
|
56
56
|
end
|
57
57
|
end
|
data/lib/atacama/transaction.rb
CHANGED
@@ -104,9 +104,11 @@ module Atacama
|
|
104
104
|
end
|
105
105
|
|
106
106
|
def return_value
|
107
|
-
@return_value ||
|
108
|
-
|
109
|
-
|
107
|
+
@return_value || return_value_from_option || nil
|
108
|
+
end
|
109
|
+
|
110
|
+
def return_value_from_option
|
111
|
+
self.class.return_option && context[self.class.return_option]
|
110
112
|
end
|
111
113
|
end
|
112
114
|
end
|
data/lib/atacama/version.rb
CHANGED