frederick_api 0.1.0 → 0.1.1

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: 3de672e56c6302f235bed63e48c4dd11978344ea
4
- data.tar.gz: 173a72637912e59ae28c5f99eca47d5c6207dfff
3
+ metadata.gz: 639b7019e1919ed4998f737434166f9b401484fd
4
+ data.tar.gz: c793239bf2e75019ca1efe3b53fe2234bbc98fa3
5
5
  SHA512:
6
- metadata.gz: 076b3051e48620744b08af1d2aae2571edecb87688341d4b748c92503157d6c46e52c4522c5ac0016a64044fcf9a30440ca31cd8b186e805a6608b1b5e0f5446
7
- data.tar.gz: 02b1230c8352a91edda3268866b185e54e4397b2185a0d37eaf896bc64f6b72c8b6d61a976865984db9ef70c66f8a0e77ee244d83e979913b83634f2e2d69698
6
+ metadata.gz: 5e5bcddde1d02e42f58059e5f194fcd446eb0dad19fe8d111c6098025e8f77e95710c4654d40c279a46c62ca51ffde363cda35cfcc030b35bffaff1a6378404a
7
+ data.tar.gz: bd211000835b4b27f72d07841ef83899ae8c79d119ff8dbd402e18dcd3ec40ea8b83c46d3a446e3ccecc5a7a790cf9f0c8b0850a88f98ebe532a8695ab3762ca
data/README.md CHANGED
@@ -67,7 +67,7 @@ location_id = '6fdf0530-3e4e-46f1-9d11-5f90c48a50dc'
67
67
  access_token = '9jsdo320fjfkfdksls30dfdcd919bcaa1b7804dbbebda0'
68
68
  FrederickAPI::V2::Location.with_access_token(access_token) do
69
69
  # Fetch a location
70
- location = FrederickAPI::V2::Location.find(location_id)
70
+ location = FrederickAPI::V2::Location.find(location_id).first
71
71
  # => #<FrederickAPI::V2::Location:0x007fd2f29a7618>
72
72
 
73
73
  location.name
@@ -84,3 +84,17 @@ FrederickAPI::V2::Location.with_access_token(access_token) do
84
84
  # => true
85
85
  end
86
86
  ```
87
+
88
+ ### Nested Resources
89
+
90
+ Nested resources must be accessed using `where` to scope the request:
91
+
92
+ ```ruby
93
+ location_id = '6fdf0530-3e4e-46f1-9d11-5f90c48a50dc'
94
+ access_token = '9jsdo320fjfkfdksls30dfdcd919bcaa1b7804dbbebda0'
95
+ FrederickAPI::V2::Location.with_access_token(access_token) do
96
+ # Find contacts
97
+ contacts = FrederickAPI::V2::Contact.where(location_id: location_id).page(1).per(100).to_a
98
+ # => [...]
99
+ end
100
+ ```
data/lib/frederick_api.rb CHANGED
@@ -11,6 +11,13 @@ require 'frederick_api/v2/resource'
11
11
  require 'frederick_api/v2/user'
12
12
  require 'frederick_api/v2/location'
13
13
 
14
+ # Froldoex resources
15
+ require 'frederick_api/v2/contact'
16
+ require 'frederick_api/v2/contact_property'
17
+ require 'frederick_api/v2/contact_list'
18
+ require 'frederick_api/v2/contact_type'
19
+ require 'frederick_api/v2/interaction'
20
+
14
21
  # Namespace for all Frederick API client methods/classes
15
22
  module FrederickAPI
16
23
  end
@@ -0,0 +1,10 @@
1
+ # frozen_string_literal: true
2
+
3
+ module FrederickAPI
4
+ module V2
5
+ # /v2/locations/:location_id/contacts
6
+ class Contact < Resource
7
+ belongs_to :location
8
+ end
9
+ end
10
+ end
@@ -0,0 +1,10 @@
1
+ # frozen_string_literal: true
2
+
3
+ module FrederickAPI
4
+ module V2
5
+ # /v2/locations/:location_id/contact_lists
6
+ class ContactList < Resource
7
+ belongs_to :location
8
+ end
9
+ end
10
+ end
@@ -0,0 +1,10 @@
1
+ # frozen_string_literal: true
2
+
3
+ module FrederickAPI
4
+ module V2
5
+ # /v2/locations/:location_id/contact_properties
6
+ class ContactProperty < Resource
7
+ belongs_to :location
8
+ end
9
+ end
10
+ end
@@ -0,0 +1,10 @@
1
+ # frozen_string_literal: true
2
+
3
+ module FrederickAPI
4
+ module V2
5
+ # /v2/locations/:location_id/contact_types
6
+ class ContactType < Resource
7
+ belongs_to :location
8
+ end
9
+ end
10
+ end
@@ -0,0 +1,10 @@
1
+ # frozen_string_literal: true
2
+
3
+ module FrederickAPI
4
+ module V2
5
+ # /v2/locations/:location_id/interactions
6
+ class Interaction < Resource
7
+ belongs_to :location
8
+ end
9
+ end
10
+ end
@@ -2,6 +2,7 @@
2
2
 
3
3
  module FrederickAPI
4
4
  module V2
5
+ # /v2/locations
5
6
  class Location < Resource
6
7
  end
7
8
  end
@@ -2,6 +2,7 @@
2
2
 
3
3
  module FrederickAPI
4
4
  module V2
5
+ # /v2/users
5
6
  class User < Resource
6
7
  end
7
8
  end
@@ -2,5 +2,5 @@
2
2
 
3
3
  module FrederickAPI
4
4
  # Current gem version
5
- VERSION = '0.1.0'
5
+ VERSION = '0.1.1'
6
6
  end
metadata CHANGED
@@ -1,27 +1,27 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: frederick_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Frederick Engineering
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-06-05 00:00:00.000000000 Z
11
+ date: 2017-06-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json_api_client
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ">="
17
+ - - "~>"
18
18
  - !ruby/object:Gem::Version
19
19
  version: 1.5.1
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - ">="
24
+ - - "~>"
25
25
  - !ruby/object:Gem::Version
26
26
  version: 1.5.1
27
27
  description: Ruby client for the Frederick API
@@ -35,6 +35,11 @@ files:
35
35
  - README.md
36
36
  - lib/frederick_api.rb
37
37
  - lib/frederick_api/configuration.rb
38
+ - lib/frederick_api/v2/contact.rb
39
+ - lib/frederick_api/v2/contact_list.rb
40
+ - lib/frederick_api/v2/contact_property.rb
41
+ - lib/frederick_api/v2/contact_type.rb
42
+ - lib/frederick_api/v2/interaction.rb
38
43
  - lib/frederick_api/v2/location.rb
39
44
  - lib/frederick_api/v2/query_builder.rb
40
45
  - lib/frederick_api/v2/resource.rb