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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2f115cdd3dc90b119a8d4e439411f6c09f06ca799965a964e9b32b7e5827dae2
4
- data.tar.gz: 0e6d8541b9c8f85dac4c280afdccb7400773208b87e6279cdc0449f8401ff6ce
3
+ metadata.gz: a0164b1f8881b683903a798061857d2894974617e0d1cde05a8e9389abec0cc8
4
+ data.tar.gz: 00dba7801dc9252b9b7319fef7f4b7de298d01ae0e1cf91f31d1f0f173be1895
5
5
  SHA512:
6
- metadata.gz: cff58d579cc9450ef348cc092681f0aee025d94f14160ce5bb070c321f96bc2bd65a428cad6918e55e309021920519f9246a8ab7c14a8f14843c7ea8121523ac
7
- data.tar.gz: 4992916597b9404e17e9312a00092e31ff934b7afbfbd929cb5de04f0dda4b7b1358c3bc05040aaaadf7ffb1bc4056bb3b50d2d5591d0e2b5c4b89b87ddd9ded
6
+ metadata.gz: b6d64e992ab4d12c1da0c281d49524e9af13629aedc6b4c462f66b4470adf6916867cb12f034f344d16d9e05d947bf4c8ad829212df3d2078c723e256957a3af
7
+ data.tar.gz: 376533c594c9e212fbb533df6c84e21c5c8280215d60a3d636941008c81123be777128c09a96d5883faad0fc4a7d7ea0f21810fa60f94087c44e21ad65603bed
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- helpscout-mailbox-paths (0.1.0)
4
+ helpscout-mailbox-paths (1.0.0)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
data/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  [![Build status](https://badge.buildkite.com/f19b143ad6bbb2fce71a361da78e974be4737e14d578d21b5d.svg)](https://buildkite.com/jayco/helpscout-mailbox-paths)
4
4
 
5
- Simple Gem for generating helpscout paths with params
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
- mailbox = Helpscout::Mailbox::Paths.generate_path(:v2_conversation, {conversation_id: 1089909636})
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 = 'Generates HelpScout V2 mailbox paths'
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 self.generate_path(path, values)
139
+ def generate_path(path, values)
139
140
  template = PATH_MAP[path]
140
141
  raise "path '#{path}' not found" if template.nil?
141
142
 
@@ -1,7 +1,9 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Helpscout
2
4
  module Mailbox
3
5
  module Paths
4
- VERSION = "0.1.0"
6
+ VERSION = '1.0.0'
5
7
  end
6
8
  end
7
9
  end
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: 0.1.0
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-12 00:00:00.000000000 Z
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: Generates HelpScout V2 mailbox paths
103
+ summary: Simple mixin for generating helpscout paths with params
104
104
  test_files: []