zaius 0.1.1 → 0.2.0

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c4add004f882b1d65204b850bea7b8f4926180a6e472d8bae977153a6cfeac37
4
- data.tar.gz: 0f30a6e526cddf04e26f8cc1499f918b7f26e524784a1739bcbb093245649733
3
+ metadata.gz: f89ceec2b4c44c75d3cf81b29d15923758c9268065dfe30b9662ede15ca3dab1
4
+ data.tar.gz: 8fc181e0ab7a7fc63371651451498a7c82c86379f2da34189fdb07dda0dedf06
5
5
  SHA512:
6
- metadata.gz: a7f26578dc5ad5ef669b59f7ab1be499a313b04f81709b8efb5836ff4c4201fb5fb1293b3c85c60c3ca7eec511312ca357c067be77f6026f8a42bd6e3ddcbeec
7
- data.tar.gz: f73c8502aa1538351997e4a9120d7abaa0741a445d47e876c5679e5aa1029a815ed47d3329bcb3bf23b71c1684abc789408f04463ece1ae2a1342f3bb6a6b773
6
+ metadata.gz: 49d4c32f7439b42908e64caa83c958324e33930e1a846525aaa40a4c1e0fa6743ddc90c672f68fb2b6839ec071201245e9e3dbcac6b2a253c8d67be4ee012556
7
+ data.tar.gz: e57f9d8c5e19eb778010dc3f5a7c24edba0a181cd4c73eb82af4354b874a61cde53c81ed0773887ad328e5e506dde2ae90065706568d20d55c857e563114114e
data/Gemfile.lock CHANGED
@@ -1,14 +1,14 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- zaius (0.1.1)
4
+ zaius (0.2.0)
5
5
  faraday (~> 0.10)
6
6
 
7
7
  GEM
8
8
  remote: https://rubygems.org/
9
9
  specs:
10
10
  byebug (10.0.2)
11
- faraday (0.15.3)
11
+ faraday (0.15.4)
12
12
  multipart-post (>= 1.2, < 3)
13
13
  minitest (5.11.3)
14
14
  multipart-post (2.0.0)
@@ -0,0 +1,28 @@
1
+ module Zaius
2
+ class Event < APIResource
3
+ OBJECT_NAME = "Event".freeze
4
+
5
+ def self.subscribe(list_id:, email:, params: {}, opts: {})
6
+ data = {
7
+ list_id: list_id
8
+ }.merge(params)
9
+
10
+ body = {
11
+ type: "list",
12
+ action: "subscribe",
13
+ identifiers: {
14
+ email: email
15
+ },
16
+ data: data
17
+ }
18
+
19
+ resp, opts = request(:post, resource_url, body, opts)
20
+
21
+ ZaiusObject.construct_from(resp.data, opts)
22
+ end
23
+
24
+ def resource_url
25
+ "/events"
26
+ end
27
+ end
28
+ end
data/lib/zaius/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Zaius
2
- VERSION = "0.1.1".freeze
2
+ VERSION = "0.2.0".freeze
3
3
  end
data/lib/zaius.rb CHANGED
@@ -14,6 +14,7 @@ require "zaius/api_resource"
14
14
  require "zaius/util"
15
15
 
16
16
  require "zaius/customer"
17
+ require "zaius/event"
17
18
  require "zaius/list"
18
19
  require "zaius/subscription"
19
20
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: zaius
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Anderson
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-10-22 00:00:00.000000000 Z
11
+ date: 2019-01-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -102,6 +102,7 @@ files:
102
102
  - lib/zaius/api_resource.rb
103
103
  - lib/zaius/customer.rb
104
104
  - lib/zaius/errors.rb
105
+ - lib/zaius/event.rb
105
106
  - lib/zaius/list.rb
106
107
  - lib/zaius/list_object.rb
107
108
  - lib/zaius/subscription.rb