portatext 1.5.3 → 1.5.4

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: 0ea1a8905e2c094b9a61e6bbee55bd6535efcfa1
4
- data.tar.gz: d312b954fd5f59223e4717cd97db2a6743f2508a
3
+ metadata.gz: 41401e253fc2cc55ccd6447026cdde796e617c6f
4
+ data.tar.gz: c245be5efc0eeb3bde15fe5ebcf0398bc0e0e32b
5
5
  SHA512:
6
- metadata.gz: a1bd0679d2a85b5849978dfb02ac3c1ccd7a126ceb34bfc6848ae8ebd83a42f20a0b7b606cd9d54c5e995b8d1bfc40febe9b4b7a447ef5f403894a669f7bf176
7
- data.tar.gz: ef53c875e5ddc7ce7c300205dc51163e869154fbc9981beaf8803aa4079b79ea53614dc8c4e999e876c52ffe784b25608746bb6fcadb3eb84fc5b6d069055bc5
6
+ metadata.gz: 467a2339e9d5fcdd74e18325131bfe1c19b1986b54d53139119ca2a7dc8aa29d21573a5f30e50aa1eddd12072ded63116e921803480fa85aec03f739f12dcc21
7
+ data.tar.gz: 14937c8f0b0bb74f5d09cfbece13a4c5699760c4eba44b282b5babd8bfea09e0dbe202a942b827995f54d33c09f96d8057aa2530631f9af84bd3a9acb6788935
data/lib/portatext.rb CHANGED
@@ -40,6 +40,7 @@ require_relative 'portatext/command/api/services'
40
40
  require_relative 'portatext/command/api/trunks'
41
41
  require_relative 'portatext/command/api/version'
42
42
  require_relative 'portatext/command/api/inspect'
43
+ require_relative 'portatext/command/api/operators'
43
44
 
44
45
  # The PortaText namespace.
45
46
  #
@@ -0,0 +1,45 @@
1
+ module PortaText
2
+ module Command
3
+ module Api
4
+ # The operators endpoint.
5
+ # https://github.com/PortaText/docs/wiki/REST-API#api_operators
6
+ #
7
+ # Author:: Marcelo Gornstein (mailto:marcelog@portatext.com)
8
+ # Copyright:: Copyright (c) 2015 PortaText
9
+ # License:: Apache-2.0
10
+ class Operators < 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 "operators?#{URI.encode_www_form qs}" unless qs.empty?
38
+ 'operators'
39
+ end
40
+ # rubocop:enable Metrics/AbcSize
41
+ # rubocop:enable Metrics/MethodLength
42
+ end
43
+ end
44
+ end
45
+ end
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.3'
3
+ s.version = '1.5.4'
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,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: portatext
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.3
4
+ version: 1.5.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - PortaText
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-06-28 00:00:00.000000000 Z
11
+ date: 2016-06-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: simplecov
@@ -155,6 +155,7 @@ files:
155
155
  - lib/portatext/command/api/me.rb
156
156
  - lib/portatext/command/api/my_password.rb
157
157
  - lib/portatext/command/api/number_verify.rb
158
+ - lib/portatext/command/api/operators.rb
158
159
  - lib/portatext/command/api/recharge.rb
159
160
  - lib/portatext/command/api/services.rb
160
161
  - lib/portatext/command/api/settings.rb