token_for 0.0.2 → 0.0.3

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f10b550279aa15d5b71e0d0de27815bb35b58166
4
- data.tar.gz: 0abadfc8b091b1d77857fcafb26515b8cb0294e3
3
+ metadata.gz: ea38a9572684f9ec82abbe2e849f2f88134f554d
4
+ data.tar.gz: 2af85fc337cc23aad4148fc63f675408626a6159
5
5
  SHA512:
6
- metadata.gz: aa8cb65350ee012e856feaef2b2d08b7afeb121eb8a486670585582b0ee7ae0b8b976bac2ea31a0b8274a56abdbf1d074e30db5cbc809c418b1f06b39f915e02
7
- data.tar.gz: 80bb709cfab61445700d8c0e9086e060d2fd1247daa5c3d70520c6cd0f4d893d2c53096cee910711881e5a8945f422f8fbe2c7f408780e325df07bea15c1b6b9
6
+ metadata.gz: 94675e47f3614ae8652916e0348997e4aae6751cb83b8cb8c07353d02b82fced76c5b6b345871858a55216ef90ba2be856c1e8eb12664011fb4ac01ce3154b94
7
+ data.tar.gz: 08b3bbf807997c361eddbcdd34bc0f4b58b6fb95d934b54825cd77612ff01e5e6316ee95fdb5da7e2768dd0df1dc31cff681064fd16c7a94d3eaec25daef0ebf
@@ -1,3 +1,3 @@
1
1
  module TokenFor
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
data/lib/token_for.rb CHANGED
@@ -5,13 +5,14 @@ module TokenFor
5
5
 
6
6
  module ClassMethods
7
7
 
8
- def token_for subject, attributes: [], expires_in: nil
8
+ def token_for subject, attrs: [], expires_in: nil
9
9
 
10
10
  # A method for generating the token
11
11
  define_method("#{subject}_token") do
12
12
  verifier = self.class.verifier_for(subject)
13
13
  attr_hash = {} # The attributes need to be in a hash
14
- attributes.map { |a| attr_hash.merge!({a.to_sym => self.read_attribute(a)}) }
14
+ binding.pry
15
+ attrs.map { |a| attr_hash.merge! a.to_sym => self.read_attribute(a) }
15
16
  attr_hash.merge!(expires_on: Time.zone.now + expires_in) if expires_in
16
17
  # Generate based on actual values of attributes.
17
18
  verifier.generate(attr_hash)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: token_for
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Janusz Pietrzyk