Class: RestClient
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- RestClient
- Defined in:
- lib/generators/restful_api_authentication/install/templates/rest_client.rb
Instance Method Summary collapse
-
#gen_api_key ⇒ Object
generates a new API key.
-
#gen_secret ⇒ Object
generates a new secret.
Instance Method Details
#gen_api_key ⇒ Object
generates a new API key
15 16 17 18 |
# File 'lib/generators/restful_api_authentication/install/templates/rest_client.rb', line 15 def gen_api_key u = UUID.new self.api_key = u.generate end |
#gen_secret ⇒ Object
generates a new secret
21 22 23 24 25 |
# File 'lib/generators/restful_api_authentication/install/templates/rest_client.rb', line 21 def gen_secret u = UUID.new d = Digest::SHA256.new << u.generate self.secret = d.to_s end |