helpscout-mailbox-paths 0.1.0 → 1.0.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 +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +14 -2
- data/helpscout-mailbox-paths.gemspec +1 -1
- data/lib/helpscout/mailbox/paths.rb +2 -1
- data/lib/helpscout/mailbox/paths/version.rb +3 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a0164b1f8881b683903a798061857d2894974617e0d1cde05a8e9389abec0cc8
|
4
|
+
data.tar.gz: 00dba7801dc9252b9b7319fef7f4b7de298d01ae0e1cf91f31d1f0f173be1895
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b6d64e992ab4d12c1da0c281d49524e9af13629aedc6b4c462f66b4470adf6916867cb12f034f344d16d9e05d947bf4c8ad829212df3d2078c723e256957a3af
|
7
|
+
data.tar.gz: 376533c594c9e212fbb533df6c84e21c5c8280215d60a3d636941008c81123be777128c09a96d5883faad0fc4a7d7ea0f21810fa60f94087c44e21ad65603bed
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
[](https://buildkite.com/jayco/helpscout-mailbox-paths)
|
4
4
|
|
5
|
-
Simple
|
5
|
+
Simple gem mixin for generating helpscout paths with params
|
6
6
|
|
7
7
|
## Installation
|
8
8
|
|
@@ -27,8 +27,20 @@ Or install it yourself as:
|
|
27
27
|
```ruby
|
28
28
|
require 'helpscout/mailbox/paths'
|
29
29
|
|
30
|
-
|
30
|
+
class SomeClient
|
31
|
+
include Helpscout::Mailbox::Paths
|
32
|
+
|
33
|
+
def send(method, path)
|
34
|
+
# do some request stuffs...
|
35
|
+
end
|
36
|
+
end
|
37
|
+
|
38
|
+
client = SomeClient.new
|
39
|
+
|
40
|
+
api = client.generate_path(:v2_conversation, {conversation_id: 1089909636})
|
31
41
|
# => {:method=>"GET", :path=>"/v2/conversations/1089909636"}
|
42
|
+
|
43
|
+
client.send(api[:method], api[:path])
|
32
44
|
```
|
33
45
|
|
34
46
|
## API Mapping
|
@@ -10,7 +10,7 @@ Gem::Specification.new do |spec|
|
|
10
10
|
spec.authors = ['Jason Jacob']
|
11
11
|
spec.email = ['hipcog@gmail.com']
|
12
12
|
|
13
|
-
spec.summary = '
|
13
|
+
spec.summary = 'Simple mixin for generating helpscout paths with params'
|
14
14
|
spec.homepage = 'https://github.com/jayco/helpscout-mailbox-paths.git'
|
15
15
|
spec.license = 'MIT'
|
16
16
|
|
@@ -6,6 +6,7 @@ module Helpscout
|
|
6
6
|
module Mailbox
|
7
7
|
module Paths
|
8
8
|
class Error < StandardError; end
|
9
|
+
|
9
10
|
PATH_MAP = {
|
10
11
|
v2_conversations_create: ['POST', '/v2/conversations'].freeze,
|
11
12
|
v2_conversations: ['GET', '/v2/conversations'].freeze,
|
@@ -135,7 +136,7 @@ module Helpscout
|
|
135
136
|
v2_workflows_update: ['PATCH', '/v2/workflows/%{workflow_id}'].freeze
|
136
137
|
}.freeze
|
137
138
|
|
138
|
-
def
|
139
|
+
def generate_path(path, values)
|
139
140
|
template = PATH_MAP[path]
|
140
141
|
raise "path '#{path}' not found" if template.nil?
|
141
142
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: helpscout-mailbox-paths
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 1.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jason Jacob
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-03-
|
11
|
+
date: 2020-03-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -100,5 +100,5 @@ requirements: []
|
|
100
100
|
rubygems_version: 3.1.2
|
101
101
|
signing_key:
|
102
102
|
specification_version: 4
|
103
|
-
summary:
|
103
|
+
summary: Simple mixin for generating helpscout paths with params
|
104
104
|
test_files: []
|