ruby-todoist-api-v7 1.0.0 → 1.0.1

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
- SHA1:
3
- metadata.gz: 45abb6cd62abf952735a4a610dfc27bb5be2b01b
4
- data.tar.gz: 7498e6b17bbd47e3f1dfe077d10d5f0d780041cb
2
+ SHA256:
3
+ metadata.gz: df19e65ed5e5d8219709deb6ada10a2e52089449f83d84d840174ccd2d65ee06
4
+ data.tar.gz: 6fb988cf0bf314284854d496150729045c0b4156b10c77252a55c64f7de51acb
5
5
  SHA512:
6
- metadata.gz: 5d3e41c717320de4bfeafff25a500c461b54b82b2eaf7404a7f278fd55efc5a5e5e56daa8951c114c26d28931c8e7ddda81902164893b914d110401ce392a497
7
- data.tar.gz: 2bbba3368706719d80b0cb7822604d0950f218bf3b5616f325d0d4a50c78e0eebb3b41be6f81039824693b663fa7e438160254cec96fb2402b3738171e13c1f6
6
+ metadata.gz: 03a93424bafb16a76eab65bd7d2bf5f337c1bbb02e06e12420ab5fb37a1a27a5e5d33ebc885cc05a176e80fcddad60b6733f6eeecf2943fe7859054c30247798
7
+ data.tar.gz: d25232ea6aaeed8cce29d47bcec77e8c79e16109ccb168acdb03efaca6a33a1cd1a2eccff9a81280ed18cd7ecdc9dc1adf497648aad2a2af15d086ac47ff89a5
@@ -5,20 +5,20 @@ module Todoist
5
5
  def initialize(type, object, temp_id = nil, uuid = nil)
6
6
  @type = type
7
7
  @object = object
8
- @temp_id = object.temp_id
8
+ @temp_id = object.is_a?(Todoist::Resource) ? object.temp_id : temp_id
9
9
  @uuid = uuid || SecureRandom.uuid
10
10
  end
11
11
 
12
12
  def arguments
13
- object.to_submittable_hash
13
+ object.is_a?(Todoist::Resource) ? object.to_submittable_hash : object
14
14
  end
15
15
 
16
16
  def to_hash
17
17
  {
18
18
  type: type,
19
19
  uuid: uuid,
20
- args: object.to_submittable_hash
20
+ args: arguments
21
21
  }.merge(temp_id ? { temp_id: temp_id} : {})
22
22
  end
23
23
  end
24
- end
24
+ end
@@ -28,10 +28,9 @@ module Todoist
28
28
  def http(uri)
29
29
  net = Net::HTTP.new(uri.host, uri.port)
30
30
  net.use_ssl = true
31
- net.verify_mode = OpenSSL::SSL::VERIFY_NONE
32
31
  net.read_timeout = 90
33
32
  net.open_timeout = 30
34
33
  net
35
34
  end
36
35
  end
37
- end
36
+ end
@@ -2,18 +2,18 @@ module Todoist
2
2
  module Service
3
3
  class Item < BaseService
4
4
  def update(id, arguments)
5
- @client.add_to_queue(create_command('item_update', arguments.merge({id: id})))
5
+ @client.queue.add(create_command('item_update', arguments.merge({id: id})))
6
6
  end
7
7
 
8
8
  def delete(ids)
9
9
  if ids.is_a?(FixNum)
10
10
  ids = [ids]
11
11
  end
12
- @client.add_to_queue(create_command('item_delete', {ids: ids}))
12
+ @client.queue.add(create_command('item_delete', {ids: ids}))
13
13
  end
14
14
 
15
15
  def close(id)
16
- @client.add_to_queue(create_command('item_close', {id: id}))
16
+ @client.queue.add(create_command('item_close', {id: id}))
17
17
  end
18
18
 
19
19
  def collection_class
@@ -21,4 +21,4 @@ module Todoist
21
21
  end
22
22
  end
23
23
  end
24
- end
24
+ end
@@ -1,3 +1,3 @@
1
1
  module Todoist
2
- VERSION = '1.0.0'
2
+ VERSION = '1.0.1'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby-todoist-api-v7
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Maarten van Vliet
@@ -123,7 +123,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
123
123
  version: '0'
124
124
  requirements: []
125
125
  rubyforge_project:
126
- rubygems_version: 2.5.2.1
126
+ rubygems_version: 2.7.6
127
127
  signing_key:
128
128
  specification_version: 4
129
129
  summary: Wrapper for todoist api.