params_encoding 0.1.0 → 0.1.1
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/params_encoding/version.rb +1 -1
- data/lib/params_encoding.rb +3 -4
- data/params_encoding-0.1.0.gem +0 -0
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2fc2736632f6e72564fc202a3d1bf1e41134449699597699d9a2f54cb0b12bcd
|
4
|
+
data.tar.gz: b32e8f574a38b70d1c82cf0194f0d5d8dce90108de31de8aee71906609f6e8be
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 635b561e0874c68ad700e1cb8e5ef954f42b3379c7e96f0bbda53d9342bf138a4d80933bc8435995633258a5b2807b1b973e0b90203eff51081897912a49b8fe
|
7
|
+
data.tar.gz: fd12eefff616795d1ceb7bf988ec6c5335115cb5ca45da0dd062f81869c1912c67c19932372d41f805f769daaabe31470ddb872e31c2c92839f87c9351d5a2f9
|
data/lib/params_encoding.rb
CHANGED
@@ -1,20 +1,19 @@
|
|
1
1
|
require "params_encoding/version"
|
2
2
|
require "base64"
|
3
|
+
require "jwt"
|
3
4
|
|
4
5
|
module ParamsEncoding
|
5
6
|
class Error < StandardError; end
|
6
7
|
|
7
8
|
def self.encode(options)
|
8
|
-
return if options.blank?
|
9
9
|
raise 'Type error, currently only hash supported!' unless options.is_a?(Hash)
|
10
|
-
token = JWT.encode options, nil, 'none'
|
10
|
+
token = ::JWT.encode options, nil, 'none'
|
11
11
|
token
|
12
12
|
end
|
13
13
|
|
14
14
|
def self.decode(options)
|
15
|
-
return if options.blank?
|
16
15
|
raise 'Type error, currently only hash supported!' unless options.is_a?(Hash)
|
17
|
-
token = JWT.decode options, nil, false
|
16
|
+
token = ::JWT.decode options, nil, false
|
18
17
|
token
|
19
18
|
end
|
20
19
|
|
Binary file
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: params_encoding
|
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
|
- wenlingang
|
@@ -69,6 +69,7 @@ files:
|
|
69
69
|
- bin/setup
|
70
70
|
- lib/params_encoding.rb
|
71
71
|
- lib/params_encoding/version.rb
|
72
|
+
- params_encoding-0.1.0.gem
|
72
73
|
- params_encoding.gemspec
|
73
74
|
homepage: https://github.com/wenlingang/params_encoding
|
74
75
|
licenses:
|