Module: LaserLemon::HasToken::InstanceMethods
- Defined in:
- lib/has_token.rb
Instance Method Summary collapse
Instance Method Details
#has_token_options ⇒ Object
36 37 38 |
# File 'lib/has_token.rb', line 36 def self.class. end |
#has_token_value ⇒ Object
40 41 42 |
# File 'lib/has_token.rb', line 40 def has_token_value Array.new([:length]){ [:characters].rand }.join end |
#set_token ⇒ Object
44 45 46 47 48 49 50 51 |
# File 'lib/has_token.rb', line 44 def set_token begin token_value = [:constructor].call(self) end while Token.exists?(:value => token_value) build_global_token(:value => token_value) write_attribute([:column], token_value) end |