ambassador 0.0.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.
data/.gitignore ADDED
@@ -0,0 +1,4 @@
1
+ *.gem
2
+ .bundle
3
+ Gemfile.lock
4
+ pkg/*
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source "http://rubygems.org"
2
+
3
+ # Specify your gem's dependencies in ambassador.gemspec
4
+ gemspec
data/Rakefile ADDED
@@ -0,0 +1,2 @@
1
+ require 'bundler'
2
+ Bundler::GemHelper.install_tasks
@@ -0,0 +1,21 @@
1
+ # -*- encoding: utf-8 -*-
2
+ $:.push File.expand_path("../lib", __FILE__)
3
+ require "ambassador/version"
4
+
5
+ Gem::Specification.new do |s|
6
+ s.name = "ambassador"
7
+ s.version = Ambassador::VERSION
8
+ s.platform = Gem::Platform::RUBY
9
+ s.authors = ["Jack Hoge", "Cody Christian"]
10
+ s.email = ["jack@67ideas.com", "cody@zferral.com"]
11
+ s.homepage = "http://getambassador.com"
12
+ s.summary = %q{A simple Ruby wrapper for the Ambassador API}
13
+ s.description = %q{The Ambassador API exposes RESTful URLs that return data in either XML or JSON. Use this gem to quickly make requests to their service.}
14
+
15
+ s.rubyforge_project = "ambassador"
16
+
17
+ s.files = `git ls-files`.split("\n")
18
+ s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
19
+ s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
20
+ s.require_paths = ["lib"]
21
+ end
@@ -0,0 +1,3 @@
1
+ module Ambassador
2
+ VERSION = "0.0.1"
3
+ end
data/lib/ambassador.rb ADDED
@@ -0,0 +1,62 @@
1
+ module Ambassador
2
+ include HTTParty
3
+
4
+ def initialize(username, api_key, response_type)
5
+ self.class.default_params :username => username, :api_key => api_key, :response_type => response_type
6
+ self.class.base_uri "https://getambassador.com/api/v1/#{username}/#{api_key}/#{response_type}"
7
+ end
8
+
9
+ #Records an instance of a campaign event
10
+ # :campaignID [required]
11
+ # :customerEmail [required]
12
+ # :ipAddress [required for referred registrations]
13
+ # :revenue
14
+ # :transactionID
15
+ # :productName
16
+ # :shortCode
17
+ # :customerID
18
+ # :customerFirstName
19
+ # :customerLastName
20
+ # :autoEmailAmbassador
21
+ def record_event(params = {})
22
+ self.class.get('/event/record', params)
23
+ end
24
+
25
+ # Retrieve info for a single ambassador.
26
+ # :customerEmail [required]
27
+ # :customerID
28
+ # :sandbox
29
+ def ambassador(params = {})
30
+ self.class.get('/ambassador/get', params)
31
+ end
32
+
33
+ # Retrieves a list of up to 50 ambassadors, optionally filtered by the parameters below.
34
+ # :pageNum
35
+ # :minBalanceMoney
36
+ # :minBalancePoints
37
+ # :minReferrals
38
+ # :sandbox
39
+ def ambassadors(params = {})
40
+ self.class.get('/ambassador/all', params)
41
+ end
42
+
43
+ #Deducts from the running commission balance for one of your customers.
44
+ # :customerEmail [required]
45
+ # :balanceType [required, "money" or "points"]
46
+ # :payoutAmt
47
+ # :customerID
48
+ # :sandbox
49
+ def deduct_balance(params = {})
50
+ self.class.get('/balance/deduct', params)
51
+ end
52
+
53
+ # Retrieves an AddThis snippet for all active campaigns for one of your customers
54
+ # :customerEmail [required]
55
+ # :productName
56
+ # :customerID
57
+ # :sandbox
58
+ # :autoEmailAmbassador
59
+ def addthis(params = {})
60
+ self.class.get('/social/addthis', params)
61
+ end
62
+ end
metadata ADDED
@@ -0,0 +1,64 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: ambassador
3
+ version: !ruby/object:Gem::Version
4
+ prerelease:
5
+ version: 0.0.1
6
+ platform: ruby
7
+ authors:
8
+ - Jack Hoge
9
+ - Cody Christian
10
+ autorequire:
11
+ bindir: bin
12
+ cert_chain: []
13
+
14
+ date: 2011-08-29 00:00:00 -04:00
15
+ default_executable:
16
+ dependencies: []
17
+
18
+ description: The Ambassador API exposes RESTful URLs that return data in either XML or JSON. Use this gem to quickly make requests to their service.
19
+ email:
20
+ - jack@67ideas.com
21
+ - cody@zferral.com
22
+ executables: []
23
+
24
+ extensions: []
25
+
26
+ extra_rdoc_files: []
27
+
28
+ files:
29
+ - .gitignore
30
+ - Gemfile
31
+ - Rakefile
32
+ - ambassador.gemspec
33
+ - lib/ambassador.rb
34
+ - lib/ambassador/version.rb
35
+ has_rdoc: true
36
+ homepage: http://getambassador.com
37
+ licenses: []
38
+
39
+ post_install_message:
40
+ rdoc_options: []
41
+
42
+ require_paths:
43
+ - lib
44
+ required_ruby_version: !ruby/object:Gem::Requirement
45
+ none: false
46
+ requirements:
47
+ - - ">="
48
+ - !ruby/object:Gem::Version
49
+ version: "0"
50
+ required_rubygems_version: !ruby/object:Gem::Requirement
51
+ none: false
52
+ requirements:
53
+ - - ">="
54
+ - !ruby/object:Gem::Version
55
+ version: "0"
56
+ requirements: []
57
+
58
+ rubyforge_project: ambassador
59
+ rubygems_version: 1.6.1
60
+ signing_key:
61
+ specification_version: 3
62
+ summary: A simple Ruby wrapper for the Ambassador API
63
+ test_files: []
64
+