dispatch-external-ids 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: f5f330ddc78874b49af6e7ea5db6fda38cece1a3
4
+ data.tar.gz: 672336788f2a4b5aa36fdd581dbd85820e4d17ff
5
+ SHA512:
6
+ metadata.gz: 9ebd7b8dbed2353c5c7333b080d19217ebd755c74f1ce563483b49e5b8bd80521964293467a95355022d28f9cc81437e12280f859282ddf619876776a0fecafa
7
+ data.tar.gz: 1a53fdc867807febac0a36c57bc206532ec9d0a26e25dac3b04faa9472836ab16c7d843dcab8beefc10b2a4116765d0ba75ce3d14ec8c6ed8c2ad67ad2b51576
data/README.md ADDED
@@ -0,0 +1,31 @@
1
+ # Dispatch::External::Ids
2
+
3
+ TODO: Write a gem description
4
+
5
+ ## Installation
6
+
7
+ Add this line to your application's Gemfile:
8
+
9
+ ```ruby
10
+ gem 'dispatch-external-ids'
11
+ ```
12
+
13
+ And then execute:
14
+
15
+ $ bundle
16
+
17
+ Or install it yourself as:
18
+
19
+ $ gem install dispatch-external-ids
20
+
21
+ ## Usage
22
+
23
+ TODO: Write usage instructions here
24
+
25
+ ## Contributing
26
+
27
+ 1. Fork it ( https://github.com/[my-github-username]/dispatch-external-ids/fork )
28
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
29
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
30
+ 4. Push to the branch (`git push origin my-new-feature`)
31
+ 5. Create a new Pull Request
@@ -0,0 +1,5 @@
1
+ module Dispatch
2
+ module ExternalIDs
3
+ VERSION = "0.0.1"
4
+ end
5
+ end
@@ -0,0 +1,46 @@
1
+ require 'dispatch/external_ids/version'
2
+ require 'httparty'
3
+ require 'pry'
4
+
5
+ module Dispatch
6
+ module ExternalIDs
7
+
8
+ class DispatchMe
9
+ include HTTParty
10
+ base_uri ENV['EXTERNAL_IDS_ENDPOINT_URL']
11
+
12
+ def self.fetch(client:, entity:, id:, access_token: nil)
13
+ query = {
14
+ filter: {
15
+ client: client,
16
+ type: entity,
17
+ id: id,
18
+ },
19
+ access_token: access_token
20
+ }
21
+
22
+ res = get('/v1/records.json', { query: query })
23
+ res['records'] if res.code == 200
24
+ end
25
+ end
26
+
27
+ class ThirdParty
28
+ include HTTParty
29
+ base_uri ENV['EXTERNAL_IDS_ENDPOINT_URL']
30
+
31
+ def self.fetch(client:, entity:, id:, access_token: nil)
32
+ query = {
33
+ filter: {
34
+ client: client,
35
+ dispatch_type: entity,
36
+ dispatch_id: id,
37
+ },
38
+ access_token: access_token
39
+ }
40
+
41
+ res = get('/v1/records.json', { query: query })
42
+ res['records'] if res.code == 200
43
+ end
44
+ end
45
+ end
46
+ end
metadata ADDED
@@ -0,0 +1,103 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: dispatch-external-ids
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Sergey Tkachenko
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2014-11-28 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
+ - !ruby/object:Gem::Dependency
28
+ name: bundler
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '1.6'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '1.6'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rake
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '10.0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '10.0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: pry
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
69
+ description: Simple wrapper to fetch info from Dispatch External IDs API
70
+ email:
71
+ - serg.t@dispatch.me
72
+ executables: []
73
+ extensions: []
74
+ extra_rdoc_files: []
75
+ files:
76
+ - README.md
77
+ - lib/dispatch/external_ids.rb
78
+ - lib/dispatch/external_ids/version.rb
79
+ homepage: http://dispatch.me
80
+ licenses:
81
+ - MIT
82
+ metadata: {}
83
+ post_install_message:
84
+ rdoc_options: []
85
+ require_paths:
86
+ - lib
87
+ required_ruby_version: !ruby/object:Gem::Requirement
88
+ requirements:
89
+ - - ">="
90
+ - !ruby/object:Gem::Version
91
+ version: '0'
92
+ required_rubygems_version: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - ">="
95
+ - !ruby/object:Gem::Version
96
+ version: '0'
97
+ requirements: []
98
+ rubyforge_project:
99
+ rubygems_version: 2.2.2
100
+ signing_key:
101
+ specification_version: 4
102
+ summary: Dispatch External IDs API wrapper
103
+ test_files: []