usercycle 0.1.0 → 0.1.1

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.
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- usercycle (0.0.2)
4
+ usercycle (0.1.0)
5
5
  httparty (>= 0.8.1)
6
6
 
7
7
  GEM
@@ -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
@@ -1,3 +1,3 @@
1
1
  module Usercycle
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
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.0
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-03-02 00:00:00.000000000 Z
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: &70284934175180 !ruby/object:Gem::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: *70284934175180
24
+ version_requirements: *70266747813980
25
25
  description: Ruby Libray for interating with the USERCycle API
26
26
  email:
27
27
  - calebawoods@gmail.com