geewiz 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/geewiz/client.rb +7 -7
- data/lib/geewiz/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d1f5049589b6ab231bba0aab5d7d437da6240845b83d92e2af6e4ad2930d8105
|
4
|
+
data.tar.gz: dd0b70dcf9b924f46d595bd19bba021dabc5b407f6024f7f009b91d00a4cb2ea
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 862ddeb1f9b44362af4761bd23796a23aa623ae681a8d44c4e494385ff45d9fd497dfea448d77127aea30716aea66749629281975f4bd7e4d4be7e6254e86d8a
|
7
|
+
data.tar.gz: ba0beadf1268fe38d63227a8286fc7a9d9d1dbe00cc41790ca2ca1a31f334169ff4bd86dab7a1c48c2b80dac73c24055d72f04e4f08f995a5b1f39079e18c304
|
data/lib/geewiz/client.rb
CHANGED
@@ -1,22 +1,26 @@
|
|
1
1
|
module Geewiz
|
2
2
|
# Client class for interacting with Geewiz.
|
3
3
|
class Client
|
4
|
+
attr_reader :vars
|
5
|
+
|
4
6
|
def initialize(input: $stdin, output: $stdout)
|
5
7
|
@input = input
|
6
8
|
@output = output
|
7
9
|
@output.sync = true
|
10
|
+
@vars = VarCache.new(self)
|
8
11
|
end
|
9
12
|
|
10
13
|
def command(type, **params) = @output.print "@#{[type, params].to_json}\n"
|
11
14
|
|
12
|
-
def read = @input.readline
|
15
|
+
def read = @input.readline
|
13
16
|
|
14
17
|
def read_response = JSON.parse(read)
|
15
18
|
|
16
19
|
def set(**options) = command("set", **options)
|
17
20
|
|
18
|
-
def card(id = nil, **params)
|
19
|
-
|
21
|
+
def card(id = nil, vars: {}, **params)
|
22
|
+
vars.each { |name, value| var(name, value) }
|
23
|
+
command "card", **params, **(id ? { id: } : {}), responseFormat: "json"
|
20
24
|
read_response
|
21
25
|
end
|
22
26
|
|
@@ -29,9 +33,5 @@ module Geewiz
|
|
29
33
|
command("var", name:, value:)
|
30
34
|
vars.store name, value
|
31
35
|
end
|
32
|
-
|
33
|
-
def vars
|
34
|
-
@vars ||= VarCache.new(self)
|
35
|
-
end
|
36
36
|
end
|
37
37
|
end
|
data/lib/geewiz/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: geewiz
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mike Nicholaides
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-08-
|
11
|
+
date: 2024-08-10 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Geewiz SDK for Ruby
|
14
14
|
email:
|