horoshop 0.0.1 → 0.1.0
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/lib/horoshop.rb +14 -4
- metadata +4 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: a64a6410feb2bb998f34680aa0768fc75ea6e26c366bd6054912e9d37a3a27ab
|
|
4
|
+
data.tar.gz: 42c5e3a7472d214181d7d728f0a66f3c840e57912272a28424b9e908b4cbd27c
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 92bc03964277af1d198374f2850749c06f3b3329608dec8f8cd1df58545599e5c942f18ef0f9c0e544c6b27a00da597ca479fd4211d40b951726126f9e7c18bb
|
|
7
|
+
data.tar.gz: 996143c53d82147bb31375f12b9608644f4e86729994789be94679e3501da0067e549ffc56cea0d9dcdd07ff70b380467b7bd6e373cc452abbd2dd2b688b80e7
|
data/lib/horoshop.rb
CHANGED
|
@@ -1,16 +1,26 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
+
require_relative 'horoshop/authorization'
|
|
4
|
+
|
|
3
5
|
# Base class used to store data about authentication
|
|
4
6
|
class Horoshop
|
|
5
|
-
|
|
7
|
+
attr_accessor :url, :login, :password, :token, :expiration_timestamp
|
|
8
|
+
|
|
9
|
+
def initialize(url:, login:, password:)
|
|
6
10
|
@url = url
|
|
7
|
-
@
|
|
11
|
+
@login = login
|
|
8
12
|
@password = password
|
|
9
13
|
@token = nil
|
|
10
14
|
@expiration_timestamp = nil
|
|
11
15
|
end
|
|
12
16
|
|
|
13
|
-
|
|
17
|
+
def token_valid?
|
|
18
|
+
return false if token.nil?
|
|
14
19
|
|
|
15
|
-
|
|
20
|
+
expiration_timestamp < Time.now
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
def refresh_token!
|
|
24
|
+
Horoshop::Authorization.new(self).authorize
|
|
25
|
+
end
|
|
16
26
|
end
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: horoshop
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.0
|
|
4
|
+
version: 0.1.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Denys Krupenov
|
|
@@ -9,7 +9,7 @@ authors:
|
|
|
9
9
|
autorequire:
|
|
10
10
|
bindir: bin
|
|
11
11
|
cert_chain: []
|
|
12
|
-
date: 2024-02-
|
|
12
|
+
date: 2024-02-22 00:00:00.000000000 Z
|
|
13
13
|
dependencies: []
|
|
14
14
|
description: Gem for exchangedata with the internet shop constructor
|
|
15
15
|
email: dkru84@gmail.com
|
|
@@ -21,7 +21,8 @@ files:
|
|
|
21
21
|
homepage: https://github.com/dkru/horoshop
|
|
22
22
|
licenses:
|
|
23
23
|
- MIT
|
|
24
|
-
metadata:
|
|
24
|
+
metadata:
|
|
25
|
+
rubygems_mfa_required: 'true'
|
|
25
26
|
post_install_message:
|
|
26
27
|
rdoc_options: []
|
|
27
28
|
require_paths:
|