driftrock-service 0.4.7 → 0.4.8
Sign up to get free protection for your applications and to get access to all the features.
@@ -5,9 +5,23 @@ module Driftrock
|
|
5
5
|
class DriftrockApp
|
6
6
|
include ::Driftrock::Service::DriftrockModel
|
7
7
|
set_api_path "/dashboard_api/visitor/apps"
|
8
|
+
|
9
|
+
[:twitter, :facebook, :adwords, :conversion, :user].each do |data_type|
|
10
|
+
define_method("requires_#{data_type}_data?".to_sym) do
|
11
|
+
requirement = method("requirement_for_#{data_type}_data").call
|
12
|
+
requirement = requirement ? requirement.to_sym : :none
|
13
|
+
requirement == :requires
|
14
|
+
end
|
15
|
+
define_method("uses_#{data_type}_data?".to_sym) do
|
16
|
+
requirement = method("requirement_for_#{data_type}_data").call
|
17
|
+
requirement = requirement ? requirement.to_sym : :none
|
18
|
+
[:requires, :optional].include?(requirement)
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
8
22
|
end
|
9
23
|
|
10
24
|
end
|
11
25
|
end
|
12
26
|
|
13
|
-
end
|
27
|
+
end
|