taskworld 0.1.1 → 0.1.2

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: c7f7de65beb4c7cdbb0fe2157afbee6c240feed9
4
- data.tar.gz: a9c1b51583c5ac0fb8a2465e7e46db19740d7a35
3
+ metadata.gz: 0cc25b98e9ab1cf1d560dc164f417d1799df82ca
4
+ data.tar.gz: fccd1c64fc575f8139b47d84240f2808545cd417
5
5
  SHA512:
6
- metadata.gz: a7a86938d85728c3c09f34844c4a7eed243bcd2ee922a4ef5816df43096e602097db1d3a37cfba7dc8c53e25927a59ec9929600ba61f1da8134fd6c9849329df
7
- data.tar.gz: 7366978dec0657e1f5f049d8cca81ceef6e23bf8fe2fe4d3fd124afdef2a5787ad4fe2682cb5280577fb3de08e49c42fce3fc7971c465e04ee7bcc831d37224b
6
+ metadata.gz: b373ce8e7bd7ab60ba85c4913e46060e038fb069ef5eeea240386ae58d1362f33e3df13cac894c0b9e32e136a4ef18639b986e62ab4a7792cc1ada2ac4e9e87e
7
+ data.tar.gz: 7ab7199b8e2ef7bc25b202dd5d7a37a250a4cd6b38d5948769c5f292e2ba27865ae11aabb72f4bcb570789a3aacf4906e191312e275a1b593c3e6b0b2b20c63c
@@ -30,12 +30,5 @@ module Taskworld
30
30
  @default_space_id = response['default_space_id']
31
31
  @workspaces = response['workspaces']
32
32
  end
33
-
34
- def call_required_field_api(required_fields, options)
35
- required_fields.each do |field|
36
- throw ArgumentError.new("Required arguments :#{field} missing") if options[field].nil?
37
- end
38
- yield
39
- end
40
33
  end
41
34
  end
@@ -1,8 +1,20 @@
1
1
  module Taskworld
2
2
  module Endpoints
3
3
  module Project
4
- def project_get_all(options = {})
5
- call_required_field_api(%i(space_id), options) { post('project.get-all', options) }
4
+ def project_create(space_id:, title:, **options)
5
+ post('project.create', options.merge(space_id: space_id, title: title))
6
+ end
7
+
8
+ def project_get_all(space_id:, **options)
9
+ post('project.get-all', options.tap { |o| o.store(:space_id, space_id) })
10
+ end
11
+
12
+ def project_update(space_id:, project_id:, **options)
13
+ post('project.update', options.merge(space_id: space_id, project_id: project_id))
14
+ end
15
+
16
+ def project_delete(space_id:, project_id:, **options)
17
+ post('project.delete', options.merge(space_id: space_id, project_id: project_id))
6
18
  end
7
19
  end
8
20
  end
@@ -1,8 +1,8 @@
1
1
  module Taskworld
2
2
  module Endpoints
3
3
  module Task
4
- def task_get(options = {})
5
- call_required_field_api(%i(space_id task_id), options) { post('task.get', options) }
4
+ def task_get(space_id:, task_id:, **options)
5
+ post('task.get', options.merge(space_id: space_id, task_id: task_id))
6
6
  end
7
7
  end
8
8
  end
@@ -1,8 +1,8 @@
1
1
  module Taskworld
2
2
  module Endpoints
3
3
  module Tasklist
4
- def tasklist_get_all(options = {})
5
- call_required_field_api(%i(space_id project_id), options) { post('tasklist.get-all', options) }
4
+ def tasklist_get_all(space_id:, project_id: , **options)
5
+ post('tasklist.get-all', options.merge(space_id: space_id, project_id: project_id))
6
6
  end
7
7
  end
8
8
  end
@@ -1,3 +1,3 @@
1
1
  module Taskworld
2
- VERSION = '0.1.1'
2
+ VERSION = '0.1.2'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: taskworld
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - shimada
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-05-06 00:00:00.000000000 Z
11
+ date: 2018-05-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -142,7 +142,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
142
142
  version: '0'
143
143
  requirements: []
144
144
  rubyforge_project:
145
- rubygems_version: 2.6.13
145
+ rubygems_version: 2.6.14
146
146
  signing_key:
147
147
  specification_version: 4
148
148
  summary: Taskworld Web API client.