aga-architecture 0.0.0 → 0.0.1
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: '08965788c2207f56a95b28f42aef6dc436bf1da970ec32560318028b96cb922c'
|
4
|
+
data.tar.gz: bd3e153ebbb68dc2d04043e6a9ae17ae75e834fd85692765ef675d0e2801124a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6bc3a9d8a69993a155b354a9ec210fa2f5188f2960e135df6a3da2ad6d8336c1c7ed094fc7d409c415bbf135d32ec4e6446c6de581f4e5fa78a7c00cbd015b41
|
7
|
+
data.tar.gz: e0930da65e0addc8af18408632d74d61f91dd792ce6b571a95a4813d848fc7aecfe16be89b7921e3d22dfde53adfab0e9700b8d5a4261b8f3c5b4c786e5cbf52
|
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.1
|
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.3
|
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.3
|
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.1
|
291
291
|
test_files: []
|