Class: UrlShortner::Generator

Inherits:
Object
  • Object
show all
Defined in:
lib/url_shortner/generator.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.generateObject



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

def self.generate
  new.generate
end

Instance Method Details

#generateObject



6
7
8
9
# File 'lib/url_shortner/generator.rb', line 6

def generate
  short_code = generateShortCode(UrlShortner.unique_key_length)
  UrlShortner.base_url + short_code
end