Module: Related::Helpers
- Included in:
- Related
- Defined in:
- lib/related/helpers.rb
Instance Method Summary collapse
-
#generate_id ⇒ Object
Generate a unique id.
-
#root ⇒ Object
Returns the root node for the graph.
Instance Method Details
#generate_id ⇒ Object
Generate a unique id
8 9 10 11 12 |
# File 'lib/related/helpers.rb', line 8 def generate_id Base64.encode64( Digest::MD5.digest("#{Time.now}-#{rand}") ).gsub('/','x').gsub('+','y').gsub('=','').strip end |