aboardly 0.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: adb2aad98dd729c4d2b4a338701b524cc56c400d
4
+ data.tar.gz: cd724d7f98183686ffb51a251ed21a7e0527803f
5
+ SHA512:
6
+ metadata.gz: f6ef3b748e663e1de700eff5c2bb7b41a144883e92a0264c8b2245f85262cff38e17cd29434c3c5df3a7259c85d9dc59537a2446a40240c72df027999cccf695
7
+ data.tar.gz: 8821420042aef10f9f9599e4b40d67108ce1b15a2b869953a3f5c5c6c10503dc41fe3ba1df9cf1c0aae46d1cdcf55339dd374d8d7767689b98835669eb21f278
@@ -0,0 +1,2 @@
1
+ require 'httparty'
2
+ require 'aboardly/client'
@@ -0,0 +1,20 @@
1
+ require_relative 'customers'
2
+ require_relative 'events'
3
+
4
+ BASE_URL = 'https://www.aboardly.com/api/v1'
5
+
6
+ class Aboardly
7
+ def initialize(username, password, base_url = BASE_URL)
8
+ auth = {username: username, password: password}
9
+ @customers = Customers.new(auth, base_url)
10
+ @events = Customers.new(auth, base_url)
11
+ end
12
+
13
+ def customers
14
+ @customers
15
+ end
16
+
17
+ def events
18
+ @events
19
+ end
20
+ end
@@ -0,0 +1,13 @@
1
+ class Customers
2
+ include HTTParty
3
+
4
+ def initialize(auth, base_url)
5
+ @auth = auth
6
+ @base_url = base_url
7
+ end
8
+
9
+ def upsert(customer_id, data = {})
10
+ options = {body: data, basic_auth: @auth}
11
+ self.class.put("#{@base_url}/customers/#{customer_id}", options)
12
+ end
13
+ end
@@ -0,0 +1,13 @@
1
+ class Customers
2
+ include HTTParty
3
+
4
+ def initialize(auth, base_url)
5
+ @auth = auth
6
+ @base_url = base_url
7
+ end
8
+
9
+ def create(customer_id, event_name)
10
+ options = {basic_auth: @auth}
11
+ self.class.post("#{@base_url}/customers/#{customer_id}/events/#{event_name}", options)
12
+ end
13
+ end
metadata ADDED
@@ -0,0 +1,62 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: aboardly
3
+ version: !ruby/object:Gem::Version
4
+ version: '0.1'
5
+ platform: ruby
6
+ authors:
7
+ - Serge Herkül
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2015-07-05 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: httparty
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '0.13'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '0.13'
27
+ description: IFTTT for automated customer emailing
28
+ email:
29
+ - serge@aboardly.com
30
+ executables: []
31
+ extensions: []
32
+ extra_rdoc_files: []
33
+ files:
34
+ - lib/aboardly.rb
35
+ - lib/aboardly/client.rb
36
+ - lib/aboardly/customers.rb
37
+ - lib/aboardly/events.rb
38
+ homepage: http://www.aboardly.com/
39
+ licenses:
40
+ - MIT
41
+ metadata: {}
42
+ post_install_message:
43
+ rdoc_options: []
44
+ require_paths:
45
+ - lib
46
+ required_ruby_version: !ruby/object:Gem::Requirement
47
+ requirements:
48
+ - - ">="
49
+ - !ruby/object:Gem::Version
50
+ version: '0'
51
+ required_rubygems_version: !ruby/object:Gem::Requirement
52
+ requirements:
53
+ - - ">="
54
+ - !ruby/object:Gem::Version
55
+ version: '0'
56
+ requirements: []
57
+ rubyforge_project:
58
+ rubygems_version: 2.4.5
59
+ signing_key:
60
+ specification_version: 4
61
+ summary: Aboardly Client for Ruby applications
62
+ test_files: []