Module: GenToken::GenTokenClassMethods

Defined in:
lib/gen_token.rb

Overview

Usage: include GenToken gen_token :key, :type => :hex, :length => AppConfig.token.token_length gen_token :password, :type => :hex, :length => AppConfig.token.token_length

Instance Method Summary collapse

Instance Method Details

#gen_token(key, options = {}) ⇒ Object



9
10
11
12
# File 'lib/gen_token.rb', line 9

def gen_token(key, options = {})
  token_def = {:name => key, :type => :hex, :length => 16}.merge(options)
  write_inheritable_array(:token_fields, [token_def])
end