daashub_api 0.3.0 → 0.3.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
2
  SHA1:
3
- metadata.gz: eed1a847f0cc5dbf0c546a595af635f3167cf21b
4
- data.tar.gz: 4abb5d6cc084ba551c85d9e700fb61d68660d078
3
+ metadata.gz: 548ac7943336fba700318ed417dac838328a3254
4
+ data.tar.gz: cd830140de7214fa206c4b7f3c3bf7967070207e
5
5
  SHA512:
6
- metadata.gz: a4f69931d3a08c867e0aeaad4bb37d3e5b92cf92de35266cb93d7fb5b51a26a1e0dbdfc34200c3219d3031347acbb04b29f5ad2090e1445f66929e4fa14f855f
7
- data.tar.gz: 90f49e093ae6f55477aa17b31e3a4cff429a9a32ff397fb8fdda1a4f210401fa1c9258b9125f909ccd481a54a5f7d4115b95250a84344e264ff09fddffceba9f
6
+ metadata.gz: 726b4af4fcbd45ce4bb6fca52d1eca26c8990f4aa88ad99f8f3fa9d6c2f5c314f1210c23047694621e219ad32a7407b1cdf9171864a443a88d4fae10fc82548c
7
+ data.tar.gz: 3c5a368f24566084374bd260067832a246af4addae4a88539e39bbe194212ad3dce7cea9d82231a1ad96027db2c4142cc478fb00336d48bb4b9d7b3f39c8f455
data/.DS_Store ADDED
Binary file
data/lib/.DS_Store ADDED
Binary file
Binary file
@@ -0,0 +1,23 @@
1
+ require 'daashub_api/base'
2
+
3
+ module DaashubAPI
4
+ class BatchFile < Base
5
+ def started_at
6
+ attr_to_date(:started_at)
7
+ end
8
+
9
+ def finished_at
10
+ attr_to_date(:finished_at)
11
+ end
12
+
13
+ def created_at
14
+ attr_to_date(:created_at)
15
+ end
16
+
17
+ private
18
+
19
+ def attr_to_date(attr_name)
20
+ (date = @attributes[attr_name]) && Time.parse(date)
21
+ end
22
+ end
23
+ end
Binary file
@@ -0,0 +1,21 @@
1
+ require 'daashub_api/batch_file'
2
+ require 'daashub_api/request'
3
+
4
+ module DaashubAPI
5
+ module REST
6
+ module BatchFile
7
+ def list_batch_files
8
+ response = DaashubAPI::Request.perform_get('/v1/batch_files',
9
+ access_token)
10
+ response['items'].map { |item| DaashubAPI::BatchFile.new(item) }
11
+ end
12
+
13
+ def create_batch_file(params)
14
+ query = { batch_file: params }
15
+ response = DaashubAPI::Request.perform_post('/v1/batch_files',
16
+ access_token, query: query)
17
+ DaashubAPI::BatchFile.new(response)
18
+ end
19
+ end
20
+ end
21
+ end
@@ -1,3 +1,3 @@
1
1
  module DaashubAPI
2
- VERSION = '0.3.0'.freeze
2
+ VERSION = '0.3.1'.freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: daashub_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Piotr Brzózka
@@ -101,6 +101,7 @@ executables: []
101
101
  extensions: []
102
102
  extra_rdoc_files: []
103
103
  files:
104
+ - ".DS_Store"
104
105
  - ".gitignore"
105
106
  - ".rspec"
106
107
  - ".travis.yml"
@@ -108,18 +109,22 @@ files:
108
109
  - LICENSE.txt
109
110
  - README.md
110
111
  - Rakefile
111
- - daashub_api-0.2.0.gem
112
112
  - daashub_api.gemspec
113
+ - lib/.DS_Store
113
114
  - lib/daashub_api.rb
115
+ - lib/daashub_api/.DS_Store
114
116
  - lib/daashub_api/account.rb
115
117
  - lib/daashub_api/base.rb
118
+ - lib/daashub_api/batch_file.rb
116
119
  - lib/daashub_api/client.rb
117
120
  - lib/daashub_api/company.rb
118
121
  - lib/daashub_api/errors.rb
119
122
  - lib/daashub_api/history.rb
120
123
  - lib/daashub_api/query.rb
121
124
  - lib/daashub_api/request.rb
125
+ - lib/daashub_api/rest/.DS_Store
122
126
  - lib/daashub_api/rest/account.rb
127
+ - lib/daashub_api/rest/batch_file.rb
123
128
  - lib/daashub_api/rest/company.rb
124
129
  - lib/daashub_api/rest/history.rb
125
130
  - lib/daashub_api/version.rb
Binary file