aga-architecture 0.0.0 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/lib/architecture/resources/alert.rb +20 -7
- data/lib/architecture/version.rb +1 -1
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a49fc8de05087bd2b4e9ab2da81731c1f1116fed9d2b32c5d5e940be92ff2683
|
4
|
+
data.tar.gz: cfb0565d79b0044a41cf44b46d1b38607b0afbacce75ff651039ecd32066d2ca
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 588c8aebbecdae9371d21a7a4b7cd6ed6d8a17f353adf3e15a25edaa0e1d94938848bbc4bec5b13abd5a047c98786fefb3d6f3c224b16f7c422881cddc9e5cc7
|
7
|
+
data.tar.gz: d0f377e3d555fbea06adca7583fa2569f0ff2133d5938276c115a77d3af559ccff3fb284ee5cf4db80c742022cf35e020fc2bb6e086f12cb4bef8e8c75c988c9
|
data/README.md
CHANGED
@@ -23,7 +23,7 @@ If bundler is not being used to manage dependencies, install the gem by executin
|
|
23
23
|
|
24
24
|
## Usage
|
25
25
|
|
26
|
-
To use Aga-
|
26
|
+
To use Aga-architecture in your application, require the gem and start making requests. Here's a basic example:
|
27
27
|
|
28
28
|
```
|
29
29
|
require 'architecture'
|
@@ -12,24 +12,37 @@ module Architecture
|
|
12
12
|
|
13
13
|
def run(response)
|
14
14
|
tm = Telegram::Message.new(token: token, chat: chat)
|
15
|
-
response&.dig(:result)
|
16
|
-
|
17
|
-
end
|
15
|
+
result = response&.dig(:result)
|
16
|
+
send_message(result: result, tm: tm)
|
18
17
|
end
|
19
18
|
|
20
19
|
private
|
20
|
+
|
21
|
+
def chat
|
22
|
+
configuration.dig('keys', @service.to_s, 'chat')
|
23
|
+
end
|
21
24
|
|
22
25
|
def configuration
|
23
26
|
file_path = File.expand_path('../config/keys.yml', __dir__)
|
24
27
|
YAML.load_file(file_path)
|
25
28
|
end
|
29
|
+
|
30
|
+
def send_message(result: ,tm:)
|
31
|
+
if result.is_a?(Array)
|
32
|
+
send_multiple(result: result, tm: tm)
|
33
|
+
else
|
34
|
+
tm.send(result)
|
35
|
+
end
|
36
|
+
end
|
37
|
+
|
38
|
+
def send_multiple(result: ,tm:)
|
39
|
+
result&.each do |r|
|
40
|
+
tm.send(r)
|
41
|
+
end
|
42
|
+
end
|
26
43
|
|
27
44
|
def token
|
28
45
|
configuration.dig('keys', @service.to_s, 'token')
|
29
46
|
end
|
30
|
-
|
31
|
-
def chat
|
32
|
-
configuration.dig('keys', @service.to_s, 'chat')
|
33
|
-
end
|
34
47
|
end
|
35
48
|
end
|
data/lib/architecture/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: aga-architecture
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Stefano Baldazzi
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-07-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: zeitwerk
|
@@ -156,14 +156,14 @@ dependencies:
|
|
156
156
|
requirements:
|
157
157
|
- - "~>"
|
158
158
|
- !ruby/object:Gem::Version
|
159
|
-
version: 0.0.
|
159
|
+
version: 0.0.4
|
160
160
|
type: :development
|
161
161
|
prerelease: false
|
162
162
|
version_requirements: !ruby/object:Gem::Requirement
|
163
163
|
requirements:
|
164
164
|
- - "~>"
|
165
165
|
- !ruby/object:Gem::Version
|
166
|
-
version: 0.0.
|
166
|
+
version: 0.0.4
|
167
167
|
- !ruby/object:Gem::Dependency
|
168
168
|
name: aga-telegram
|
169
169
|
requirement: !ruby/object:Gem::Requirement
|
@@ -287,5 +287,5 @@ requirements: []
|
|
287
287
|
rubygems_version: 3.3.24
|
288
288
|
signing_key:
|
289
289
|
specification_version: 4
|
290
|
-
summary: aga-architecture0.0.
|
290
|
+
summary: aga-architecture0.0.4
|
291
291
|
test_files: []
|