ondotori-ruby-client 0.0.1 → 0.0.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 +4 -4
- data/README.md +9 -0
- data/lib/ondotori/version.rb +1 -1
- data/lib/ondotori/webapi/api/params.rb +3 -2
- data/lib/ondotori/webapi/client.rb +7 -0
- data/ondotori-ruby-client.gemspec +1 -3
- metadata +3 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8096355f04b5718a1d4f4ed9534b079003a3ba889543e1a89ae96b8bee9c489e
|
4
|
+
data.tar.gz: f8bac6cf07635b37d87a0e5341f651dd391dd13525d34d199ec0fb71af7787cd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 11b3d0fb4cf81c1559d19cceac6e6b10798c8227ef62d47266b1e2824f426cdb0b6a0c8792c573a96a0820740359d7975bbf0ee3a5a544f3b693b6a1f776dfcb
|
7
|
+
data.tar.gz: b28be6ae1e5c3bbe6fd1cb032f6c6d87cd54b64b5ca029c91d5a15450949d844f1008bc714373618f64d3465eea7d913386456706c4be351ff187ff42ea7988b
|
data/README.md
CHANGED
@@ -48,6 +48,15 @@ params = { "api-key" => "API Key you create", "login-id" => "tbxxxx", "login-pas
|
|
48
48
|
client = Ondotori::WebAPI::Client.new(params)
|
49
49
|
response = client.current()
|
50
50
|
```
|
51
|
+
#### Get Latest Data
|
52
|
+
|
53
|
+
To get latest data, do the following.
|
54
|
+
|
55
|
+
```
|
56
|
+
params = { "api-key" => "API Key you create", "login-id" => "tbxxxx", "login-pass" => "password"}
|
57
|
+
client = Ondotori::WebAPI::Client.new(params)
|
58
|
+
response = client.latest_data("SERIAL")
|
59
|
+
```
|
51
60
|
|
52
61
|
#### Error Handling
|
53
62
|
|
data/lib/ondotori/version.rb
CHANGED
@@ -29,12 +29,13 @@ module Ondotori
|
|
29
29
|
end
|
30
30
|
|
31
31
|
class LatestDataParams
|
32
|
-
def initialize(
|
32
|
+
def initialize(param, serial: "")
|
33
33
|
if serial.empty?
|
34
34
|
raise Ondotori::WebAPI::Api::Errors::InvaildParameter.new(
|
35
|
-
"latest-data need remote-serial",
|
35
|
+
"latest-data need remote-serial", 9994
|
36
36
|
)
|
37
37
|
end
|
38
|
+
@param = param
|
38
39
|
@remote_serial = serial
|
39
40
|
end
|
40
41
|
|
@@ -17,6 +17,13 @@ module Ondotori
|
|
17
17
|
ondotori_response.result
|
18
18
|
end
|
19
19
|
|
20
|
+
def latest_data(serial)
|
21
|
+
param = Api::LatestDataParams.new(@param, serial: serial)
|
22
|
+
response = @web_access.access("#{base_uri}latest-data", param.to_ondotori_param)
|
23
|
+
ondotori_response = Ondotori::WebAPI::Api::Response.new(response)
|
24
|
+
ondotori_response.result
|
25
|
+
end
|
26
|
+
|
20
27
|
def base_uri
|
21
28
|
return @uri unless @uri.empty?
|
22
29
|
|
@@ -9,9 +9,7 @@ Gem::Specification.new do |spec|
|
|
9
9
|
spec.email = ["k28@me.com"]
|
10
10
|
|
11
11
|
spec.summary = "T&D WebStorage API Client"
|
12
|
-
spec.description =
|
13
|
-
You can use this gem to get the recorded data from WebStorage.
|
14
|
-
TXT
|
12
|
+
spec.description = "You can use this gem to get the recorded data from WebStorage."
|
15
13
|
spec.homepage = "https://github.com/k28/ondotori-ruby-client"
|
16
14
|
spec.license = "MIT"
|
17
15
|
spec.required_ruby_version = Gem::Requirement.new(">= 2.4.0")
|
metadata
CHANGED
@@ -1,18 +1,16 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ondotori-ruby-client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kazuya Hatano
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-02-
|
11
|
+
date: 2021-02-23 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
|
-
description:
|
14
|
-
|
15
|
-
'
|
13
|
+
description: You can use this gem to get the recorded data from WebStorage.
|
16
14
|
email:
|
17
15
|
- k28@me.com
|
18
16
|
executables: []
|