portatext 1.5.7 → 1.5.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/portatext/command/api/summary.rb +45 -0
- data/lib/portatext.rb +1 -0
- data/portatext.gemspec +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 35bffa2f4cac707d032ca4168fe9993d5b3dfa54
|
4
|
+
data.tar.gz: 5071db640b2d775fd61713a21d2e8e0937275fef
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
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.
|
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-
|
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
|