Class: SUID

Inherits:
Object
  • Object
show all
Defined in:
lib/suid/suid.rb,
lib/suid/version.rb

Constant Summary

VERSION =
"1.0.1"

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeSUID



2
3
4
# File 'lib/suid/suid.rb', line 2

def initialize
  @value = rand(0xffffffffffffffff)
end

Class Method Details

.generateObject



14
15
16
# File 'lib/suid/suid.rb', line 14

def self.generate
  new.to_s
end

Instance Method Details

#to_iObject



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

def to_i
  @value
end

#to_sObject



6
7
8
# File 'lib/suid/suid.rb', line 6

def to_s
  @str ||= to_string
end