zenbox 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,39 +0,0 @@
1
- module Contextify
2
- module UserHelper
3
- def self.included(base)
4
- base.extend(ClassMethods)
5
- end
6
-
7
- # TODO: Catch errors because of missing methods and prompt the
8
- # user, "Tried to sync a non-existant method with
9
- # contextify. Please make sure to implement #{method_name} on your
10
- # model"
11
- def contextify_sync!
12
- Contextify.post(self.email, contextify_data)
13
- end
14
-
15
- def contextify_data(*fields)
16
- fields = fields.empty? ? self.class.class_variable_get('@@contextify_fields') : fields
17
-
18
- fields.inject({}) { |run, field| run[field] = self.send(field.to_sym); run }
19
- end
20
-
21
- module ClassMethods
22
- def self.extended(base)
23
- base.class_variable_set("@@contextify_fields", [])
24
-
25
- Contextify.model = base.to_s
26
- end
27
-
28
- def contextify_fields=(*args)
29
- self.class_variable_set("@@contextify_fields", args)
30
- end
31
-
32
- def contextify_user(*fields)
33
- self.send(:contextify_fields=, *fields)
34
-
35
- after_commit :contextify_sync!
36
- end
37
- end
38
- end
39
- end
@@ -1,3 +0,0 @@
1
- module Contextify
2
- VERSION = "0.0.3"
3
- end