portatext 1.5.4 → 1.5.5

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
  SHA1:
3
- metadata.gz: 41401e253fc2cc55ccd6447026cdde796e617c6f
4
- data.tar.gz: c245be5efc0eeb3bde15fe5ebcf0398bc0e0e32b
3
+ metadata.gz: 22bf1a7a7267817d57ca3d8aa28bbf42fa20a3af
4
+ data.tar.gz: 0f84619c5e4afd7648eb43758644c92df88e3081
5
5
  SHA512:
6
- metadata.gz: 467a2339e9d5fcdd74e18325131bfe1c19b1986b54d53139119ca2a7dc8aa29d21573a5f30e50aa1eddd12072ded63116e921803480fa85aec03f739f12dcc21
7
- data.tar.gz: 14937c8f0b0bb74f5d09cfbece13a4c5699760c4eba44b282b5babd8bfea09e0dbe202a942b827995f54d33c09f96d8057aa2530631f9af84bd3a9acb6788935
6
+ metadata.gz: e347e1a29ba2d7705cb5ae26905ec57b475848ff5c15051e6e5087ab4bb1a000264f7f8772315da21c2494da49fc508bc4003b3a9ddf7b354b337c24303aed40
7
+ data.tar.gz: ce97194d28de950c56667aba32ea4e7e5d76296be455e569799646728b74dd8d96da8a0581351901f0884d6fb19594ad09a6a4f668da2e8770a5938f046ce591
@@ -0,0 +1,45 @@
1
+ module PortaText
2
+ module Command
3
+ module Api
4
+ # The destinations endpoint.
5
+ # https://github.com/PortaText/docs/wiki/REST-API#api_destinations
6
+ #
7
+ # Author:: Marcelo Gornstein (mailto:marcelog@portatext.com)
8
+ # Copyright:: Copyright (c) 2015 PortaText
9
+ # License:: Apache-2.0
10
+ class Destinations < Base
11
+ def page(page)
12
+ set :page, page
13
+ end
14
+
15
+ def sort_by(sort_by, order)
16
+ set :sort_by, sort_by
17
+ set :order, order
18
+ end
19
+
20
+ # rubocop:disable Metrics/MethodLength
21
+ # rubocop:disable Metrics/AbcSize
22
+ def endpoint(_method)
23
+ qs = {}
24
+ unless @args[:page].nil?
25
+ qs['page'] = @args[:page]
26
+ @args.delete :page
27
+ end
28
+ unless @args[:sort_by].nil?
29
+ qs['sort_by'] = @args[:sort_by]
30
+ @args.delete :sort_by
31
+ end
32
+ unless @args[:order].nil?
33
+ qs['order'] = @args[:order]
34
+ @args.delete :order
35
+ end
36
+
37
+ return "destinations?#{URI.encode_www_form qs}" unless qs.empty?
38
+ 'destinations'
39
+ end
40
+ # rubocop:enable Metrics/AbcSize
41
+ # rubocop:enable Metrics/MethodLength
42
+ end
43
+ end
44
+ end
45
+ end
data/lib/portatext.rb CHANGED
@@ -41,6 +41,7 @@ require_relative 'portatext/command/api/trunks'
41
41
  require_relative 'portatext/command/api/version'
42
42
  require_relative 'portatext/command/api/inspect'
43
43
  require_relative 'portatext/command/api/operators'
44
+ require_relative 'portatext/command/api/destinations'
44
45
 
45
46
  # The PortaText namespace.
46
47
  #
data/portatext.gemspec CHANGED
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'portatext'
3
- s.version = '1.5.4'
3
+ s.version = '1.5.5'
4
4
  s.summary = 'Official PortaText API ruby client'
5
5
  s.description = 'This is the official PortaText API ruby client'
6
6
  s.authors = ['PortaText']
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: portatext
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.4
4
+ version: 1.5.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - PortaText
@@ -147,6 +147,7 @@ files:
147
147
  - lib/portatext/command/api/contact_lists.rb
148
148
  - lib/portatext/command/api/contacts.rb
149
149
  - lib/portatext/command/api/credit_cards.rb
150
+ - lib/portatext/command/api/destinations.rb
150
151
  - lib/portatext/command/api/did_search.rb
151
152
  - lib/portatext/command/api/did_settings.rb
152
153
  - lib/portatext/command/api/email_verify.rb