Class: DynamicLinks::ShorteningStrategies::NanoIDStrategy
- Inherits:
-
BaseStrategy
- Object
- BaseStrategy
- DynamicLinks::ShorteningStrategies::NanoIDStrategy
- Defined in:
- lib/dynamic_links/shortening_strategies/nano_id_strategy.rb
Overview
Shortens the given URL using Nano ID This strategy will generate a different short URL for the same given URL
Constant Summary
Constants inherited from BaseStrategy
BaseStrategy::BASE62_CHARS, BaseStrategy::MIN_LENGTH
Instance Method Summary collapse
-
#shorten(url, size: MIN_LENGTH) ⇒ Object
Shortens the given URL using Nano ID.
Instance Method Details
#shorten(url, size: MIN_LENGTH) ⇒ Object
Shortens the given URL using Nano ID
15 16 17 |
# File 'lib/dynamic_links/shortening_strategies/nano_id_strategy.rb', line 15 def shorten(url, size: MIN_LENGTH) ::Nanoid.generate(size: size) end |