saddle 0.0.25 → 0.0.26
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 +8 -8
- data/lib/saddle/endpoint.rb +16 -15
- data/lib/saddle/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
MjI5ZDhlYmRmZTVmNzFlZWQ2ZWM2MWFhZWFjNGM2Yjc1NWY0OTVkZQ==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
ZGMyZDgzMGQyOGVlYWQ5MTY1YTljYmE4ZmE0NTgyNmU3OWI4ODMxMw==
|
7
7
|
!binary "U0hBNTEy":
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
YWY5MmZhZWRiNDdmNDJlMDk2NWExNWZlN2ZlMjcxMjU4OWNlNjljYzEyMDdm
|
10
|
+
NzZkZTQwYzhhNWMxZDg5MjdjMTA2ODhjNjdmY2Q0ZWVkNjEyOWJhZWZkZGU0
|
11
|
+
MzE1Yzc2NjY5Yjc4YTViNTBjN2JlMDk1ZjJhYzhkZjU4NjI0NTA=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
ODFlM2VhODY0NTBjZGFkZTA2MzgwOTAzZDQ4ZTQzNWFiNzJmNzM1YTY3NDdj
|
14
|
+
YjYxYWI4OGE4ZWQ3ZjRhZWMwNGU0NWU4YzA3ZmY3NWY4NjUxMWIxZDM2NjA5
|
15
|
+
MDQ5MDA5OWU4OGVhNWZlYTRlYzU1ODRkMjZjMTNkYWE4Y2ExNWY=
|
data/lib/saddle/endpoint.rb
CHANGED
@@ -20,24 +20,36 @@ module Saddle
|
|
20
20
|
@relative_path = relative_path_override || _relative_path()
|
21
21
|
end
|
22
22
|
|
23
|
+
|
24
|
+
# Generic request wrapper
|
25
|
+
def request(method, action, params={}, options={})
|
26
|
+
# Augment in interesting options
|
27
|
+
options[:saddle] ||= {}
|
28
|
+
options[:saddle] = {
|
29
|
+
:call_chain => _path_array(),
|
30
|
+
:action => action,
|
31
|
+
}
|
32
|
+
@requester.send(method, _path(action), params, options)
|
33
|
+
end
|
34
|
+
|
23
35
|
# Provide GET functionality for the implementer class
|
24
36
|
def get(action, params={}, options={})
|
25
|
-
|
37
|
+
request(:get, action, params, options)
|
26
38
|
end
|
27
39
|
|
28
40
|
# Provide POST functionality for the implementer class
|
29
41
|
def post(action, params={}, options={})
|
30
|
-
|
42
|
+
request(:post, action, params, options)
|
31
43
|
end
|
32
44
|
|
33
45
|
# Provide PUT functionality for the implementer class
|
34
46
|
def put(action, params={}, options={})
|
35
|
-
|
47
|
+
request(:put, action, params, options)
|
36
48
|
end
|
37
49
|
|
38
50
|
# Provide DELETE functionality for the implementer class
|
39
51
|
def delete(action, params={}, options={})
|
40
|
-
|
52
|
+
request(:delete, action, params, options)
|
41
53
|
end
|
42
54
|
|
43
55
|
|
@@ -67,17 +79,6 @@ module Saddle
|
|
67
79
|
|
68
80
|
protected
|
69
81
|
|
70
|
-
def _request(method, action, params={}, options={})
|
71
|
-
# Augment in interesting options
|
72
|
-
options[:saddle] ||= {}
|
73
|
-
options[:saddle] = {
|
74
|
-
:call_chain => _path_array(),
|
75
|
-
:action => action,
|
76
|
-
}
|
77
|
-
@requester.send(method, _path(action), params, options)
|
78
|
-
end
|
79
|
-
|
80
|
-
|
81
82
|
# Get the url path for this endpoint/action combo
|
82
83
|
def _path(action=nil)
|
83
84
|
paths = _path_array()
|
data/lib/saddle/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: saddle
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.26
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mike Lewis
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-
|
11
|
+
date: 2013-06-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|