portatext 1.5.7 → 1.5.8

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: 816dab987d21987f3583aa2d2e91bd5abc9d743b
4
- data.tar.gz: 671096c8839d59631ad36d11081bb3f7d7f0184c
3
+ metadata.gz: 35bffa2f4cac707d032ca4168fe9993d5b3dfa54
4
+ data.tar.gz: 5071db640b2d775fd61713a21d2e8e0937275fef
5
5
  SHA512:
6
- metadata.gz: 13c0172664c5040aa245d29d73edca32d3a15c7fffef165571498483eccdbfef6ca4c8d220da94b8e8a8cb0825a96d4519f002ee8632449ee8caec3465378363
7
- data.tar.gz: 42f52741b8250873e4aa11154077cb9627d90d02bff875cb70832b3ae55cdfd4572e74616ad3726f33ef7d11e9feebbc55b974d324826ea41f3f2cdec2fa6a45
6
+ metadata.gz: 2eaab982ca696aa49f6bc1c42a43539dabf3a3f2a614f6b817b9d6d79c9638ab4625a068a93894d0cfafd5873b8eb6c2da24ac4c47fa0005106b99692e735182
7
+ data.tar.gz: 87fe1d18768cabb99c2f6ecc4b42df089083a40e902d156a61c2d82cc1d3b0e6cdb2be2231f097ebd54712d11a19ebdcf83e7cfb9108b0abe41ae459eff4c9ff
@@ -0,0 +1,45 @@
1
+ module PortaText
2
+ module Command
3
+ module Api
4
+ # The summary endpoint.
5
+ # https://github.com/PortaText/docs/wiki/REST-API#api_summary
6
+ #
7
+ # Author:: Marcelo Gornstein (mailto:marcelog@portatext.com)
8
+ # Copyright:: Copyright (c) 2015 PortaText
9
+ # License:: Apache-2.0
10
+ class Summary < Base
11
+ def to(date)
12
+ set :date_to, date
13
+ end
14
+
15
+ def from(date)
16
+ set :date_from, date
17
+ end
18
+
19
+ def save_to(file)
20
+ set :accept_file, file
21
+ end
22
+
23
+ # rubocop:disable Metrics/MethodLength
24
+ def endpoint(_method)
25
+ qs = {}
26
+ unless @args[:date_from].nil?
27
+ qs[:date_from] = @args[:date_from]
28
+ @args.delete :date_from
29
+ end
30
+ unless @args[:date_to].nil?
31
+ qs[:date_to] = @args[:date_to]
32
+ @args.delete :date_to
33
+ end
34
+ unless qs.empty?
35
+ qs = URI.encode_www_form qs
36
+ return "summary?#{qs}"
37
+ end
38
+
39
+ 'summary'
40
+ end
41
+ # rubocop:enable Metrics/MethodLength
42
+ end
43
+ end
44
+ end
45
+ end
data/lib/portatext.rb CHANGED
@@ -43,6 +43,7 @@ require_relative 'portatext/command/api/inspect'
43
43
  require_relative 'portatext/command/api/operators'
44
44
  require_relative 'portatext/command/api/destinations'
45
45
  require_relative 'portatext/command/api/simulate'
46
+ require_relative 'portatext/command/api/summary'
46
47
 
47
48
  # The PortaText namespace.
48
49
  #
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.7'
3
+ s.version = '1.5.8'
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.7
4
+ version: 1.5.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - PortaText
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-07-03 00:00:00.000000000 Z
11
+ date: 2016-07-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: simplecov
@@ -163,6 +163,7 @@ files:
163
163
  - lib/portatext/command/api/simulate.rb
164
164
  - lib/portatext/command/api/sms.rb
165
165
  - lib/portatext/command/api/sms_campaign.rb
166
+ - lib/portatext/command/api/summary.rb
166
167
  - lib/portatext/command/api/tariffs.rb
167
168
  - lib/portatext/command/api/templates.rb
168
169
  - lib/portatext/command/api/timezones.rb