portatext 1.1.11 → 1.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/portatext.rb +1 -1
- data/lib/portatext/command/api/{variables.rb → contacts.rb} +27 -5
- data/portatext.gemspec +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f757968cdfd9305d7e5e048402aaf954582b60cd
|
4
|
+
data.tar.gz: 0b88c4094fa1a4bffdc46348c78ab4d798021002
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 27239e1b739d42de7cb548c696bca24f830e6648447f80dd2ef6b39356c85f69e078cd5e90606516d867ae01b9bcd6a73ee5fce559374ccd72b8b51f36e0dd90
|
7
|
+
data.tar.gz: b7c350b9cb5abb6ac81168f903d1b44c3d07db4952aa2fe8f11fb547026c97f79ee14858ba44c5b335db9ef100b619cba41e58e20b0d611cf244d51bc082d6cf
|
data/lib/portatext.rb
CHANGED
@@ -34,7 +34,7 @@ require_relative 'portatext/command/api/campaigns'
|
|
34
34
|
require_relative 'portatext/command/api/sms_campaign'
|
35
35
|
require_relative 'portatext/command/api/campaign_lifecycle'
|
36
36
|
require_relative 'portatext/command/api/my_password'
|
37
|
-
require_relative 'portatext/command/api/
|
37
|
+
require_relative 'portatext/command/api/contacts'
|
38
38
|
require_relative 'portatext/command/api/number_verify'
|
39
39
|
|
40
40
|
# The PortaText namespace.
|
@@ -1,17 +1,25 @@
|
|
1
1
|
module PortaText
|
2
2
|
module Command
|
3
3
|
module Api
|
4
|
-
# The
|
5
|
-
# https://github.com/PortaText/docs/wiki/REST-API#
|
4
|
+
# The contacts endpoint.
|
5
|
+
# https://github.com/PortaText/docs/wiki/REST-API#api_all_contacts
|
6
6
|
#
|
7
7
|
# Author:: Marcelo Gornstein (mailto:marcelog@portatext.com)
|
8
8
|
# Copyright:: Copyright (c) 2015 PortaText
|
9
9
|
# License:: Apache-2.0
|
10
|
-
class
|
11
|
-
def
|
10
|
+
class Contacts < Base
|
11
|
+
def id(number)
|
12
12
|
set :number, number
|
13
13
|
end
|
14
14
|
|
15
|
+
def with_contact_lists
|
16
|
+
set :with_contact_lists, true
|
17
|
+
end
|
18
|
+
|
19
|
+
def page(page)
|
20
|
+
set :page, page
|
21
|
+
end
|
22
|
+
|
15
23
|
def name(name)
|
16
24
|
set :name, name
|
17
25
|
end
|
@@ -38,8 +46,20 @@ module PortaText
|
|
38
46
|
end
|
39
47
|
# rubocop:enable Style/AccessorMethodName
|
40
48
|
|
49
|
+
# rubocop:disable Metrics/MethodLength
|
50
|
+
# rubocop:disable Metrics/AbcSize
|
41
51
|
def endpoint(_method)
|
42
|
-
|
52
|
+
qs = {}
|
53
|
+
unless @args[:page].nil?
|
54
|
+
qs['page'] = @args[:page]
|
55
|
+
@args.delete :page
|
56
|
+
end
|
57
|
+
unless @args[:with_contact_lists].nil?
|
58
|
+
qs['with_contact_lists'] = 'true'
|
59
|
+
@args.delete :with_contact_lists
|
60
|
+
end
|
61
|
+
qs = URI.encode_www_form qs
|
62
|
+
return "contacts?#{qs}" if @args[:number].nil?
|
43
63
|
number = @args[:number]
|
44
64
|
@args.delete :number
|
45
65
|
return "contacts/#{number}/variables" if @args[:name].nil?
|
@@ -47,6 +67,8 @@ module PortaText
|
|
47
67
|
@args.delete :name
|
48
68
|
"contacts/#{number}/variables/#{name}"
|
49
69
|
end
|
70
|
+
# rubocop:enable Metrics/MethodLength
|
71
|
+
# rubocop:enable Metrics/AbcSize
|
50
72
|
end
|
51
73
|
end
|
52
74
|
end
|
data/portatext.gemspec
CHANGED
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.
|
4
|
+
version: 1.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- PortaText
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-02-
|
11
|
+
date: 2016-02-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: simplecov
|
@@ -145,6 +145,7 @@ files:
|
|
145
145
|
- lib/portatext/command/api/campaigns.rb
|
146
146
|
- lib/portatext/command/api/cnam.rb
|
147
147
|
- lib/portatext/command/api/contact_lists.rb
|
148
|
+
- lib/portatext/command/api/contacts.rb
|
148
149
|
- lib/portatext/command/api/credit_cards.rb
|
149
150
|
- lib/portatext/command/api/did_search.rb
|
150
151
|
- lib/portatext/command/api/did_settings.rb
|
@@ -160,7 +161,6 @@ files:
|
|
160
161
|
- lib/portatext/command/api/tariffs.rb
|
161
162
|
- lib/portatext/command/api/templates.rb
|
162
163
|
- lib/portatext/command/api/timezones.rb
|
163
|
-
- lib/portatext/command/api/variables.rb
|
164
164
|
- lib/portatext/command/base.rb
|
165
165
|
- lib/portatext/command/descriptor.rb
|
166
166
|
- lib/portatext/command/result.rb
|