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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 335ed96b6ab74f8124f60984363e39c1bf535f48ef37f18406cf7e3f43d58f86
4
- data.tar.gz: 4cbfa18a83fd71bd8d29f5a8ca39f63251263c6849878d76304162fa0f4f653e
3
+ metadata.gz: 8096355f04b5718a1d4f4ed9534b079003a3ba889543e1a89ae96b8bee9c489e
4
+ data.tar.gz: f8bac6cf07635b37d87a0e5341f651dd391dd13525d34d199ec0fb71af7787cd
5
5
  SHA512:
6
- metadata.gz: b1a6b1a13d2e82386c97d7b2fd6dc2702dbfe87c3172b25f1dfcb69209842c56dd3a2eabe98e42a8cdf0f6bee97da6480982bcf0a6319367d323bb029ddc3647
7
- data.tar.gz: 58cf6d9f26bb298d4d5869b681a171e9076909815a5dc033fcea148f5f3e5c6f24f3f5d3c74416113f8c783f05466fa170f25159423752946ba4f71c169b84fc
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
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Ondotori
4
- VERSION = "0.0.1"
4
+ VERSION = "0.0.2"
5
5
  end
@@ -29,12 +29,13 @@ module Ondotori
29
29
  end
30
30
 
31
31
  class LatestDataParams
32
- def initialize(_param, serial)
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", 9998
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 = <<-TXT.gsub(/^ +/, '')
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.1
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-22 00:00:00.000000000 Z
11
+ date: 2021-02-23 00:00:00.000000000 Z
12
12
  dependencies: []
13
- description: 'You can use this gem to get the recorded data from WebStorage.
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: []