portatext 1.5.11 → 1.5.12

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: cf0232edbd09b5ccb65d88ebd36d936e13a820b4
4
- data.tar.gz: 9d96c246c39482fa2e92b3f7d981ce9ed80af5d3
3
+ metadata.gz: cd7b75f11ecedf5492ff000f64c625e503c0f5ed
4
+ data.tar.gz: 4e6ab4f6a32bb1153f351cb3862c6005c81e5fd3
5
5
  SHA512:
6
- metadata.gz: c1bfdfc131867114b23ebbaada023fff242f4f7ac0c4f683c5579a4f9811dfab846f233ed57b53fb2968b5c58f9703e22f93a836b69d58cc07e41fa5c3a94e40
7
- data.tar.gz: 04822b0061add91bf150a8ff8fa9ea4a418e9916b56bc00692fded5f41ae2c135eb58044cf366506455be9e8a5d6521c18abf7126bfb19c7b62001dd911f0fe3
6
+ metadata.gz: eca7ecc3c0ce61e0f0444a9ba34e3bfbbef050c8b8ba09dd5048fed4796f1289dbb16273861a2937c31a040d832095bb34dfd3f8cd73aae65da1bf606591ccc7
7
+ data.tar.gz: a15bc7121fa4d06c94efa53780d78390ca8c416d2bc61d8428c5e83d5868f618a941808e012402c5cbd6169aa5c191041df95fd6bdb3a98c5687050dc275c011
@@ -20,7 +20,20 @@ module PortaText
20
20
  set :accept_file, file
21
21
  end
22
22
 
23
+ def by_day
24
+ set :granularity, 'date'
25
+ end
26
+
27
+ def by_month
28
+ set :granularity, 'month'
29
+ end
30
+
31
+ def by_week
32
+ set :granularity, 'week'
33
+ end
34
+
23
35
  # rubocop:disable Metrics/MethodLength
36
+ # rubocop:disable Metrics/AbcSize
24
37
  def endpoint(_method)
25
38
  qs = {}
26
39
  unless @args[:date_from].nil?
@@ -31,6 +44,10 @@ module PortaText
31
44
  qs[:date_to] = @args[:date_to]
32
45
  @args.delete :date_to
33
46
  end
47
+ unless @args[:granularity].nil?
48
+ qs[:granularity] = @args[:granularity]
49
+ @args.delete :granularity
50
+ end
34
51
  unless qs.empty?
35
52
  qs = URI.encode_www_form qs
36
53
  return "summary?#{qs}"
@@ -38,6 +55,7 @@ module PortaText
38
55
 
39
56
  'summary'
40
57
  end
58
+ # rubocop:enable Metrics/AbcSize
41
59
  # rubocop:enable Metrics/MethodLength
42
60
  end
43
61
  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.11'
3
+ s.version = '1.5.12'
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.11
4
+ version: 1.5.12
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-13 00:00:00.000000000 Z
11
+ date: 2016-07-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: simplecov