Class: String

Inherits:
Object show all
Defined in:
lib/smooth/ext/core.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.random_token(length = 12) ⇒ Object



18
19
20
# File 'lib/smooth/ext/core.rb', line 18

def self.random_token(length = 12)
  rand(36**36).to_s(36).slice(0, length)
end

Instance Method Details

#empty?Boolean

Returns:

  • (Boolean)


14
15
16
# File 'lib/smooth/ext/core.rb', line 14

def empty?
  length == 0
end