contactually-ruby 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ca49195fe60d8e9e06181f7dd4a8bec6c68f008b
4
- data.tar.gz: 06cd3a35e1a1fbc2df24ee3eccf4640719b533e5
3
+ metadata.gz: faa362189301f2e0dd58053b961c86f29c2857b3
4
+ data.tar.gz: 72ef6ecddbd5047a7f8e4e84207e55bc91e5ff79
5
5
  SHA512:
6
- metadata.gz: 3abac75528e1e2fc3307df86dfc9223050795351dec7a627c83b5627a8f35ebf65b319eb052a3c661e3f97ccbf0ef58dbc62e50617d5c1ef8b66cc74de1c1367
7
- data.tar.gz: 03502ad51ec24596b735eda32c5ea6fb63bae6fc361366266af1b9f78c16f08fe89d2e3d68d7fda45c917352e14607cd26539e7f8d10c009f5ff56b02cfde180
6
+ metadata.gz: 5029836eb4eed981955147f0796a6847638383ef621cfcd3f3eddf4956baf2ea677cf07fb17a0c811b1beb10a3aa1e512a23b4d8b80575de013afc535e883591
7
+ data.tar.gz: 6c1550446daf6390e75c502bda7d4d27c974cf5d91b2a495aa3feb0261072d5280b7df5f117ab1bd6e8c95e327c810721a6dcecb3d418c87b8c4a29872551edf
@@ -37,7 +37,7 @@ module Contactually
37
37
  def build_object(type, hash)
38
38
  representer_class = "Contactually::Representer::#{type.classify}Representer".constantize
39
39
  object_class = "Contactually::#{type.classify}".constantize
40
- representer_class.new(object_class.new).from_hash(hash)
40
+ representer_class.new(object_class.new).from_hash(hash['data'])
41
41
  end
42
42
  end
43
43
  end
@@ -1,3 +1,3 @@
1
1
  module Contactually
2
- VERSION = "0.0.3"
2
+ VERSION = "0.0.4"
3
3
  end
@@ -37,7 +37,7 @@ describe Contactually::Accounts do
37
37
 
38
38
  describe '#show' do
39
39
  it 'calls the api with correct params' do
40
- allow(@master).to receive(:call).with('accounts/1.json', :get, { foo: :bar }).and_return({ id: 1 })
40
+ allow(@master).to receive(:call).with('accounts/1.json', :get, { foo: :bar }).and_return({ 'data' => {id: 1 }})
41
41
  subject.show(1, { foo: :bar })
42
42
  expect(@master).to have_received(:call)
43
43
  end
@@ -44,7 +44,7 @@ describe Contactually::Buckets do
44
44
 
45
45
  describe '#show' do
46
46
  it 'calls the api with correct params' do
47
- allow(@master).to receive(:call).with('buckets/1.json', :get, { foo: :bar }).and_return({ id: 1 })
47
+ allow(@master).to receive(:call).with('buckets/1.json', :get, { foo: :bar }).and_return({ 'data' => {id: 1}})
48
48
  subject.show(1, { foo: :bar })
49
49
  expect(@master).to have_received(:call)
50
50
  end
@@ -23,7 +23,7 @@ describe Contactually::ContactGroupings do
23
23
 
24
24
  describe '#create' do
25
25
  it 'calls the api with correct params' do
26
- allow(@master).to receive(:call).with('contacts/1/groupings.json', :post, { grouping_id: 512 }).and_return({ 'id' => 1234 })
26
+ allow(@master).to receive(:call).with('contacts/1/groupings.json', :post, { grouping_id: 512 }).and_return({ 'data' => {'id' => 1234 }})
27
27
  subject.create(1, { grouping_id: 512 })
28
28
  expect(@master).to have_received(:call)
29
29
  end
@@ -53,7 +53,7 @@ describe Contactually::Contacts do
53
53
 
54
54
  describe '#show' do
55
55
  it 'calls the api with correct params' do
56
- allow(@master).to receive(:call).with('contacts/1.json', :get, { foo: :bar }).and_return({ id: 1 })
56
+ allow(@master).to receive(:call).with('contacts/1.json', :get, { foo: :bar }).and_return({ 'data' => {id: 1 }})
57
57
  subject.show(1, { foo: :bar })
58
58
  expect(@master).to have_received(:call)
59
59
  end
@@ -58,7 +58,7 @@ describe Contactually::Contents do
58
58
 
59
59
  describe '#show' do
60
60
  it 'calls the api with correct params' do
61
- allow(@master).to receive(:call).with('contents/1.json', :get, { foo: :bar }).and_return({ id: 1 })
61
+ allow(@master).to receive(:call).with('contents/1.json', :get, { foo: :bar }).and_return({ 'data' => {id: 1 }})
62
62
  subject.show(1, { foo: :bar })
63
63
  expect(@master).to have_received(:call)
64
64
  end
@@ -1,10 +1,12 @@
1
1
  {
2
- "id": 13123,
3
- "username": "lol@rofl.com",
4
- "remote_id": "lol@rofl.com",
5
- "type": "Account::Google",
6
- "disabled_at": null,
7
- "name": "Google Contacts",
8
- "nice_label": "lol@rofl.com",
9
- "can_sync_contacts": true
2
+ "data": {
3
+ "id": 13123,
4
+ "username": "lol@rofl.com",
5
+ "remote_id": "lol@rofl.com",
6
+ "type": "Account::Google",
7
+ "disabled_at": null,
8
+ "name": "Google Contacts",
9
+ "nice_label": "lol@rofl.com",
10
+ "can_sync_contacts": true
11
+ }
10
12
  }
@@ -1,8 +1,10 @@
1
1
  {
2
- "id": 41296013,
3
- "name": "Bucket Test",
4
- "goal": "Test",
5
- "reminder_interval": 55,
6
- "created_at": "2013-07-02T15:45:01Z",
7
- "updated_at": "2013-07-02T15:45:01Z"
2
+ "data": {
3
+ "id": 41296013,
4
+ "name": "Bucket Test",
5
+ "goal": "Test",
6
+ "reminder_interval": 55,
7
+ "created_at": "2013-07-02T15:45:01Z",
8
+ "updated_at": "2013-07-02T15:45:01Z"
9
+ }
8
10
  }
@@ -1,38 +1,40 @@
1
1
  {
2
- "id": 41296013,
3
- "user_id": 7,
4
- "first_name": "Test",
5
- "last_name": "Ing",
6
- "full_name": "Test Ing",
7
- "initials": "TI",
8
- "title": "",
9
- "company": null,
10
- "email": "testing@contact.com",
11
- "avatar": "",
12
- "avatar_url": "",
13
- "last_contacted": null,
14
- "visible": true,
15
- "twitter": null,
16
- "facebook_url": null,
17
- "linkedin_url": null,
18
- "first_contacted": null,
19
- "created_at": "2013-07-02T15:45:01Z",
20
- "updated_at": "2013-07-02T15:45:01Z",
21
- "hits": 0,
22
- "team_parent_id": null,
23
- "snoozed_at": null,
24
- "snooze_days": null,
25
- "groupings": [],
26
- "email_addresses": [
27
- "testing@contact.com"
28
- ],
29
- "tags": [],
30
- "contact_status": null,
31
- "team_last_contacted": null,
32
- "team_last_contacted_by": null,
33
- "phone_numbers": [],
34
- "addresses": [],
35
- "social_profiles": [],
36
- "websites": [],
37
- "custom_fields": []
2
+ "data": {
3
+ "id": 41296013,
4
+ "user_id": 7,
5
+ "first_name": "Test",
6
+ "last_name": "Ing",
7
+ "full_name": "Test Ing",
8
+ "initials": "TI",
9
+ "title": "",
10
+ "company": null,
11
+ "email": "testing@contact.com",
12
+ "avatar": "",
13
+ "avatar_url": "",
14
+ "last_contacted": null,
15
+ "visible": true,
16
+ "twitter": null,
17
+ "facebook_url": null,
18
+ "linkedin_url": null,
19
+ "first_contacted": null,
20
+ "created_at": "2013-07-02T15:45:01Z",
21
+ "updated_at": "2013-07-02T15:45:01Z",
22
+ "hits": 0,
23
+ "team_parent_id": null,
24
+ "snoozed_at": null,
25
+ "snooze_days": null,
26
+ "groupings": [],
27
+ "email_addresses": [
28
+ "testing@contact.com"
29
+ ],
30
+ "tags": [],
31
+ "contact_status": null,
32
+ "team_last_contacted": null,
33
+ "team_last_contacted_by": null,
34
+ "phone_numbers": [],
35
+ "addresses": [],
36
+ "social_profiles": [],
37
+ "websites": [],
38
+ "custom_fields": []
39
+ }
38
40
  }
@@ -1,10 +1,12 @@
1
1
  {
2
- "id": 18,
3
- "url": null,
4
- "title": "Lolokopter",
5
- "description": null,
6
- "user_id": 622,
7
- "created_at": "2014-09-05T15:26:47Z",
8
- "article": null,
9
- "groupings": []
2
+ "data": {
3
+ "id": 18,
4
+ "url": null,
5
+ "title": "Lolokopter",
6
+ "description": null,
7
+ "user_id": 622,
8
+ "created_at": "2014-09-05T15:26:47Z",
9
+ "article": null,
10
+ "groupings": []
11
+ }
10
12
  }
@@ -1,19 +1,21 @@
1
1
  {
2
- "id": 1234123,
3
- "type": "Grouping::Bucket",
4
- "name": "Acquaintance",
5
- "stub": "acquaintance",
6
- "user_id": 421232,
7
- "domain_id": null,
8
- "editable": null,
9
- "conversable": null,
10
- "locked": false,
11
- "derived_from_id": null,
12
- "created_at": "2014-08-19T11:29:55Z",
13
- "updated_at": "2014-09-03T22:14:05Z",
14
- "has_followups": true,
15
- "num_days_to_followup": 90,
16
- "program_id": null,
17
- "objective": false,
18
- "sort_order": 0
2
+ "data": {
3
+ "id": 1234123,
4
+ "type": "Grouping::Bucket",
5
+ "name": "Acquaintance",
6
+ "stub": "acquaintance",
7
+ "user_id": 421232,
8
+ "domain_id": null,
9
+ "editable": null,
10
+ "conversable": null,
11
+ "locked": false,
12
+ "derived_from_id": null,
13
+ "created_at": "2014-08-19T11:29:55Z",
14
+ "updated_at": "2014-09-03T22:14:05Z",
15
+ "has_followups": true,
16
+ "num_days_to_followup": 90,
17
+ "program_id": null,
18
+ "objective": false,
19
+ "sort_order": 0
20
+ }
19
21
  }
@@ -1,7 +1,9 @@
1
1
  {
2
- "id": 1234,
3
- "body": "This is a note",
4
- "contact_id": 123123,
5
- "timestamp": "2014-09-03T09:14:52Z",
6
- "user_id": 123
2
+ "data": {
3
+ "id": 1234,
4
+ "body": "This is a note",
5
+ "contact_id": 123123,
6
+ "timestamp": "2014-09-03T09:14:52Z",
7
+ "user_id": 123
8
+ }
7
9
  }
@@ -1,27 +1,29 @@
1
1
  {
2
- "id": 123123,
3
- "title": "Lolokopter",
4
- "due_date": "2015-10-01T00:00:00Z",
5
- "interaction_type": null,
6
- "completed_at": null,
7
- "deleted_at": null,
8
- "is_follow_up": false,
9
- "last_contacted": null,
10
- "contact_id": 1234,
11
- "ignored": null,
12
- "completed_via": null,
13
- "user_id": 12345,
14
- "approval_data": {
15
- "approval_type": false,
16
- "approval_text": false,
17
- "approval_url": false,
18
- "approval_template": false,
19
- "approval_account_id": false
20
- },
21
- "contact_program_step_id": null,
22
- "unresponded_followup_id": null,
23
- "user_bucket": {
24
- "id": 12312,
25
- "name": "Colleague"
2
+ "data": {
3
+ "id": 123123,
4
+ "title": "Lolokopter",
5
+ "due_date": "2015-10-01T00:00:00Z",
6
+ "interaction_type": null,
7
+ "completed_at": null,
8
+ "deleted_at": null,
9
+ "is_follow_up": false,
10
+ "last_contacted": null,
11
+ "contact_id": 1234,
12
+ "ignored": null,
13
+ "completed_via": null,
14
+ "user_id": 12345,
15
+ "approval_data": {
16
+ "approval_type": false,
17
+ "approval_text": false,
18
+ "approval_url": false,
19
+ "approval_template": false,
20
+ "approval_account_id": false
21
+ },
22
+ "contact_program_step_id": null,
23
+ "unresponded_followup_id": null,
24
+ "user_bucket": {
25
+ "id": 12312,
26
+ "name": "Colleague"
27
+ }
26
28
  }
27
29
  }
@@ -38,7 +38,7 @@ describe Contactually::Groupings do
38
38
 
39
39
  describe '#create' do
40
40
  it 'calls the api with correct params' do
41
- allow(@master).to receive(:call).with('groupings.json', :post, { grouping: { foo: :bar }}).and_return({ 'id' => 1234 })
41
+ allow(@master).to receive(:call).with('groupings.json', :post, { grouping: { foo: :bar }}).and_return({ 'data' => {'id' => 1234 }})
42
42
  subject.create({ grouping: { foo: :bar }})
43
43
  expect(@master).to have_received(:call)
44
44
  end
@@ -59,7 +59,7 @@ describe Contactually::Groupings do
59
59
 
60
60
  describe '#show' do
61
61
  it 'calls the api with correct params' do
62
- allow(@master).to receive(:call).with('groupings/1.json', :get, { foo: :bar }).and_return({ id: 1234 })
62
+ allow(@master).to receive(:call).with('groupings/1.json', :get, { foo: :bar }).and_return({ 'data' => {id: 1234 }})
63
63
  subject.show(1, { foo: :bar })
64
64
  expect(@master).to have_received(:call)
65
65
  end
@@ -72,7 +72,7 @@ describe Contactually::Groupings do
72
72
 
73
73
  describe '#update' do
74
74
  it 'calls the api with correct params' do
75
- allow(@master).to receive(:call).with('groupings/1.json', :put, { grouping: { foo: :bar }}).and_return({ id: 1234 })
75
+ allow(@master).to receive(:call).with('groupings/1.json', :put, { grouping: { foo: :bar }}).and_return({ 'data' => {id: 1234 }})
76
76
  subject.update(1, { grouping: { foo: :bar }})
77
77
  expect(@master).to have_received(:call)
78
78
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: contactually-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tim Segraves
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-07-18 00:00:00.000000000 Z
11
+ date: 2016-07-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport