inplay_ai 0.1.3 → 0.1.5
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 +2 -4
- data/lib/inplay_ai/version.rb +1 -1
- data/lib/inplay_ai.rb +13 -4
- 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: be9853f9e6bd71919df765364d8420c1f8ff95d1f06e8fdfb6d05159a1238be0
|
4
|
+
data.tar.gz: 397a8ade49768eb4b680f220ae25ea69b6d5b708551f81b7ede3feb479f0c835
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d0649c4f1367deb625b2ce651d854bf801ac9b3e9d29dccc75028d7c643d47d28f6fbaaf8fe3c1781fa8f6633306155df6aef849f3c25f9f206d4c903b50c40f
|
7
|
+
data.tar.gz: ab0c5879e783a846c7d4479bc1e1ad532a0cffdbea002a41ab659ea3c1fe5699524d176e1cbe04a597f46a0d932d757976eb94ed361ac000e8ac622dd12b2195
|
data/README.md
CHANGED
@@ -21,10 +21,8 @@ gem install inplay_ai
|
|
21
21
|
```ruby
|
22
22
|
require 'inplay_ai'
|
23
23
|
|
24
|
-
client
|
25
|
-
|
26
|
-
api_url: 'https://api.inplay.ai' # or your API base URL
|
27
|
-
)
|
24
|
+
# Use the singleton client for efficient connection reuse
|
25
|
+
client = InplayAi::Client.instance
|
28
26
|
|
29
27
|
# Send a wager event
|
30
28
|
client.wager({
|
data/lib/inplay_ai/version.rb
CHANGED
data/lib/inplay_ai.rb
CHANGED
@@ -3,14 +3,11 @@
|
|
3
3
|
require_relative "inplay_ai/version"
|
4
4
|
require "http"
|
5
5
|
require "json"
|
6
|
-
require "singleton"
|
7
6
|
|
8
7
|
module InplayAi
|
9
8
|
class Error < StandardError; end
|
10
9
|
|
11
10
|
class Client
|
12
|
-
include Singleton
|
13
|
-
|
14
11
|
DEFAULT_API_URL = "https://api.inplay.ai"
|
15
12
|
|
16
13
|
def initialize(api_key: nil, api_url: nil)
|
@@ -36,8 +33,15 @@ module InplayAi
|
|
36
33
|
post("/v1/metadata/user", data)
|
37
34
|
end
|
38
35
|
|
36
|
+
# Create or update multiple markets in batch.
|
37
|
+
def markets(data)
|
38
|
+
post("/v1/metadata/markets", data)
|
39
|
+
end
|
40
|
+
|
41
|
+
# DEPRECATED: Use markets() instead.
|
39
42
|
def market(data)
|
40
|
-
|
43
|
+
warn "market() is deprecated. Use markets() with an array instead."
|
44
|
+
post("/v1/metadata/markets", [data])
|
41
45
|
end
|
42
46
|
|
43
47
|
def target(data)
|
@@ -48,6 +52,11 @@ module InplayAi
|
|
48
52
|
post("/v1/metadata/event", data)
|
49
53
|
end
|
50
54
|
|
55
|
+
# Thread-safe per-thread singleton instance
|
56
|
+
def self.instance
|
57
|
+
Thread.current[:inplay_ai_client] ||= new
|
58
|
+
end
|
59
|
+
|
51
60
|
private
|
52
61
|
|
53
62
|
def post(path, data)
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: inplay_ai
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- InPlay AI
|
8
8
|
bindir: exe
|
9
9
|
cert_chain: []
|
10
|
-
date: 2025-06-
|
10
|
+
date: 2025-06-27 00:00:00.000000000 Z
|
11
11
|
dependencies:
|
12
12
|
- !ruby/object:Gem::Dependency
|
13
13
|
name: http
|