usercycle 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile.lock +1 -1
- data/lib/usercycle/event.rb +8 -5
- data/lib/usercycle/version.rb +1 -1
- metadata +4 -4
data/Gemfile.lock
CHANGED
data/lib/usercycle/event.rb
CHANGED
@@ -1,16 +1,18 @@
|
|
1
1
|
module Usercycle
|
2
2
|
module Event
|
3
|
-
|
3
|
+
class UnsupportedEvent < StandardError; end
|
4
|
+
SUPPORTED_EVENTS = %w[signed_up activated came_back upgraded downgraded billed referred referred_by canceled]
|
5
|
+
|
4
6
|
def event
|
5
7
|
@event ||= Event.new self
|
6
8
|
end
|
7
|
-
|
9
|
+
|
8
10
|
class Event
|
9
|
-
|
11
|
+
|
10
12
|
def initialize(client)
|
11
13
|
@client = client
|
12
14
|
end
|
13
|
-
|
15
|
+
|
14
16
|
# List events by identity
|
15
17
|
#
|
16
18
|
# client.event.find_by_identity('john.smith@example.com')
|
@@ -30,9 +32,10 @@ module Usercycle
|
|
30
32
|
# @client.event.create(@params)
|
31
33
|
#
|
32
34
|
def create(params)
|
35
|
+
raise UnsupportedEvent unless SUPPORTED_EVENTS.include? params[:action_name].to_s
|
33
36
|
options = { :body => params }
|
34
37
|
@client.class.post('/events.json', options)
|
35
38
|
end
|
36
39
|
end
|
37
40
|
end
|
38
|
-
end
|
41
|
+
end
|
data/lib/usercycle/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: usercycle
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-
|
12
|
+
date: 2012-08-31 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: httparty
|
16
|
-
requirement: &
|
16
|
+
requirement: &70266747813980 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -21,7 +21,7 @@ dependencies:
|
|
21
21
|
version: 0.8.1
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *70266747813980
|
25
25
|
description: Ruby Libray for interating with the USERCycle API
|
26
26
|
email:
|
27
27
|
- calebawoods@gmail.com
|