jsonapionify 0.12.0 → 0.12.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/lib/jsonapionify/api/resource/definitions/actions.rb +0 -23
- data/lib/jsonapionify/api/resource/definitions/helpers.rb +0 -4
- data/lib/jsonapionify/api/resource/definitions/hooks.rb +36 -0
- data/lib/jsonapionify/api/resource/definitions.rb +1 -0
- data/lib/jsonapionify/version.rb +1 -1
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
YWU0OGU1ODA1MjVkZmYzOGIxZTBmZTQyNGE3YTc4ZWQzNDM2OTY0OQ==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
YjI5NTNmNzdkOThkYzgwYWU0NTMwOTY2YzdiZmM1NTMzZDhkNmZlZQ==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
OGFiY2IzNWNhNWRlY2U1Zjk0MTQzMDI3YjlhZGNmNTI4ZThkYjYyOGU3ZmFl
|
10
|
+
M2M5YTc2YjI3MDkzOGIxMTFiMGZjYTVkY2EzODc1OTgxNTBkNWNjNGZiNWI4
|
11
|
+
ZGM0NGU3M2RhNDVkMWY2YzI1YTJiOTAxNTNhNDVkNGYyNjhkZGE=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
MDhjNzZkMTc1M2YwYzJkOWFiODkzMzEzYzNiZjU4MGMyNTcyYThlN2JiYzdl
|
14
|
+
OGFmNjNjYjdjOTI2NDU4N2MyZmJlYjU4MGVjY2NhZDM0Y2I3MjM3OWE5YjZl
|
15
|
+
YTAyNzMzYjBlNjk1ZDM2OTUzMDNhNWEyNGMzYWQxMzgwMDY0ZDE=
|
@@ -49,20 +49,6 @@ module JSONAPIonify::Api
|
|
49
49
|
def self.extended(klass)
|
50
50
|
klass.class_eval do
|
51
51
|
extend JSONAPIonify::InheritedAttributes
|
52
|
-
define_callbacks(
|
53
|
-
:request,
|
54
|
-
:exception,
|
55
|
-
:response,
|
56
|
-
:list, :commit_list,
|
57
|
-
:create, :commit_create,
|
58
|
-
:read, :commit_read,
|
59
|
-
:update, :commit_update,
|
60
|
-
:delete, :commit_delete,
|
61
|
-
:show, :commit_show,
|
62
|
-
:add, :commit_add,
|
63
|
-
:remove, :commit_remove,
|
64
|
-
:replace, :commit_replace
|
65
|
-
)
|
66
52
|
inherited_array_attribute :action_definitions
|
67
53
|
end
|
68
54
|
end
|
@@ -110,15 +96,6 @@ module JSONAPIonify::Api
|
|
110
96
|
end
|
111
97
|
end
|
112
98
|
|
113
|
-
%i{before after}.each do |cb|
|
114
|
-
define_method(cb) do |*action_names, &block|
|
115
|
-
return send(:"#{cb}_request", &block) if action_names.blank?
|
116
|
-
action_names.each do |action_name|
|
117
|
-
send("#{cb}_#{action_name}", &block)
|
118
|
-
end
|
119
|
-
end
|
120
|
-
end
|
121
|
-
|
122
99
|
def define_action(name, *args, **options, &block)
|
123
100
|
Action.new(name, *args, **options, &block).tap do |new_action|
|
124
101
|
action_definitions.delete new_action
|
@@ -0,0 +1,36 @@
|
|
1
|
+
module JSONAPIonify::Api
|
2
|
+
module Resource::Definitions::Hooks
|
3
|
+
def self.extended(klass)
|
4
|
+
klass.class_eval do
|
5
|
+
define_callbacks(
|
6
|
+
:request,
|
7
|
+
:exception,
|
8
|
+
:response,
|
9
|
+
:list, :commit_list,
|
10
|
+
:create, :commit_create,
|
11
|
+
:read, :commit_read,
|
12
|
+
:update, :commit_update,
|
13
|
+
:delete, :commit_delete,
|
14
|
+
:show, :commit_show,
|
15
|
+
:add, :commit_add,
|
16
|
+
:remove, :commit_remove,
|
17
|
+
:replace, :commit_replace
|
18
|
+
)
|
19
|
+
class << klass
|
20
|
+
alias_method :on_exeception, :before_exception
|
21
|
+
remove_method :before_exception
|
22
|
+
remove_method :after_exception
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
%i{before after}.each do |cb|
|
28
|
+
define_method(cb) do |*action_names, &block|
|
29
|
+
return send(:"#{cb}_request", &block) if action_names.blank?
|
30
|
+
action_names.each do |action_name|
|
31
|
+
send("#{cb}_#{action_name}", &block)
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
data/lib/jsonapionify/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jsonapionify
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.12.
|
4
|
+
version: 0.12.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jason Waldrip
|
@@ -583,6 +583,7 @@ files:
|
|
583
583
|
- lib/jsonapionify/api/resource/definitions/attributes.rb
|
584
584
|
- lib/jsonapionify/api/resource/definitions/contexts.rb
|
585
585
|
- lib/jsonapionify/api/resource/definitions/helpers.rb
|
586
|
+
- lib/jsonapionify/api/resource/definitions/hooks.rb
|
586
587
|
- lib/jsonapionify/api/resource/definitions/includes.rb
|
587
588
|
- lib/jsonapionify/api/resource/definitions/pagination.rb
|
588
589
|
- lib/jsonapionify/api/resource/definitions/params.rb
|