base_action 1.1.2 → 2.0.0
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.
- checksums.yaml +4 -4
- data/lib/actions/base.rb +5 -6
- 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: 46782a8ca6506a0174a8fc0fcf8575c18c118d12
|
4
|
+
data.tar.gz: f81c28ca04805b39cc69fda9993f6458a1eb4f11
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 081a579672c9aba14d738ac904bd1e0bdd7ee3bb01fb3837ce2db2da8a24da3a73634c7cce42a8919139b9e0ad655bda8dd91f34e3d5a875fce953de83e0711e
|
7
|
+
data.tar.gz: 0d116f9f75571a9b0831c0d18e7d566764ae4d1556d84445c9e065a190344f2fe71e6058998af3e99903a2b87e1a44191ad163ccc7e96a26e437e3c512c97b01
|
data/lib/actions/base.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
module Actions
|
2
2
|
class Base
|
3
|
-
attr_reader :data, :errors, :error_type
|
3
|
+
attr_reader :data, :errors, :error_type
|
4
4
|
|
5
5
|
def initialize(params = {})
|
6
6
|
@errors = []
|
@@ -19,10 +19,9 @@ module Actions
|
|
19
19
|
error?
|
20
20
|
end
|
21
21
|
|
22
|
-
def error(errors = []
|
23
|
-
@errors = errors
|
22
|
+
def error(type, errors = [])
|
24
23
|
@error_type = type
|
25
|
-
@
|
24
|
+
@errors = errors
|
26
25
|
end
|
27
26
|
|
28
27
|
def set(attr, val)
|
@@ -30,8 +29,8 @@ module Actions
|
|
30
29
|
@data[attr] = val
|
31
30
|
end
|
32
31
|
|
33
|
-
def
|
34
|
-
@data
|
32
|
+
def get(attr)
|
33
|
+
@data && @attr[attr]
|
35
34
|
end
|
36
35
|
|
37
36
|
def run
|