Module: QuickShort::HasShortId::InstanceMethods
- Defined in:
- lib/quick_short/has_short_id.rb
Overview
Instance methods for things that has_short_id
Instance Method Summary collapse
-
#short_id ⇒ String
Get the short id (expects a method named #id to be defined on this class).
Instance Method Details
#short_id ⇒ String
Get the short id (expects a method named #id to be defined on this class)
25 26 27 28 29 30 |
# File 'lib/quick_short/has_short_id.rb', line 25 def short_id if id prefix = QuickShort.short_id_prefixes.key(self.class) "#{prefix}-#{QuickShort::ShortId.encode(id)}" end end |