driftrock-service 0.4.12 → 0.4.13
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.
- data/lib/driftrock-service/connector.rb +1 -1
- data/lib/driftrock-service/driftrock_model.rb +10 -0
- data/lib/driftrock-service/driftrock_model/driftrock_app.rb +1 -6
- data/lib/driftrock-service/version.rb +1 -1
- metadata +3 -4
- data/lib/driftrock-service/driftrock_model/admin/driftrock_company.rb +0 -10
@@ -9,7 +9,7 @@ module Driftrock
|
|
9
9
|
end
|
10
10
|
|
11
11
|
def post_to_api(url, user_id, company_id, data)
|
12
|
-
response = HTTParty.post(build_url_for_driftrock(url),
|
12
|
+
response = HTTParty.post(build_url_for_driftrock(url), timeout: 180,
|
13
13
|
:body => body_for(user_id, company_id, data))
|
14
14
|
debug_request(url, user_id, company_id, data, response)
|
15
15
|
response
|
@@ -35,6 +35,16 @@ module Driftrock::Service::DriftrockModel
|
|
35
35
|
new(object_hash)
|
36
36
|
end
|
37
37
|
|
38
|
+
def method_missing(method_sym, *args, &block)
|
39
|
+
if method_sym =~ /^find_by_.+$/
|
40
|
+
type = method_sym.to_s.gsub(/^find_by_/, '')
|
41
|
+
object_hash = get_from_api_method.call("/#{type}/#{args.first}")
|
42
|
+
new(object_hash)
|
43
|
+
else
|
44
|
+
super
|
45
|
+
end
|
46
|
+
end
|
47
|
+
|
38
48
|
def all
|
39
49
|
object_arr = get_from_api_method.call("/")
|
40
50
|
object_arr.map do |object_hash|
|
@@ -58,12 +58,7 @@ module Driftrock::Service::DriftrockModel
|
|
58
58
|
end
|
59
59
|
status
|
60
60
|
end
|
61
|
-
|
62
|
-
def self.find_by_app_id(app_id)
|
63
|
-
object_hash = get_from_api_method.call("/#{app_id}/by_app_id")
|
64
|
-
new(object_hash)
|
65
|
-
end
|
66
|
-
|
61
|
+
|
67
62
|
def self.all_for_current_user
|
68
63
|
array_of_app_hashes = get_from_api_method.call("/apps_for_current_user")
|
69
64
|
array_of_app_hashes.map do |app_hash|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: driftrock-service
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.13
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-
|
12
|
+
date: 2013-07-09 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: httparty
|
@@ -70,7 +70,6 @@ files:
|
|
70
70
|
- lib/driftrock-service/driftrock_logger.rb
|
71
71
|
- lib/driftrock-service/driftrock_model.rb
|
72
72
|
- lib/driftrock-service/driftrock_model/admin/driftrock_app.rb
|
73
|
-
- lib/driftrock-service/driftrock_model/admin/driftrock_company.rb
|
74
73
|
- lib/driftrock-service/driftrock_model/admin/driftrock_user.rb
|
75
74
|
- lib/driftrock-service/driftrock_model/channel.rb
|
76
75
|
- lib/driftrock-service/driftrock_model/channel_type.rb
|
@@ -107,7 +106,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
107
106
|
version: '0'
|
108
107
|
requirements: []
|
109
108
|
rubyforge_project:
|
110
|
-
rubygems_version: 1.8.
|
109
|
+
rubygems_version: 1.8.25
|
111
110
|
signing_key:
|
112
111
|
specification_version: 3
|
113
112
|
summary: Maintains the api endpoints and the calls to them with authorisation, etc.
|