Module: ActiveRecord::HashidsUri::InstanceMethods

Defined in:
lib/hashids_uri.rb

Instance Method Summary collapse

Instance Method Details

#generate_hashidObject



48
49
50
51
52
53
# File 'lib/hashids_uri.rb', line 48

def generate_hashid
  ::Hashids.new(
    salt,
    min_length
  ).encode(id)
end

#min_lengthObject



44
45
46
# File 'lib/hashids_uri.rb', line 44

def min_length
  self.class.min_length
end

#saltObject



40
41
42
# File 'lib/hashids_uri.rb', line 40

def salt
  self.class.salt
end

#to_paramObject



55
56
57
# File 'lib/hashids_uri.rb', line 55

def to_param
  hashid
end