Module: ActiveRecord::HashidsUri::InstanceMethods

Defined in:
lib/hashids_uri.rb

Instance Method Summary collapse

Instance Method Details

#hashidObject



45
46
47
48
49
50
# File 'lib/hashids_uri.rb', line 45

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

#min_lengthObject



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

def min_length
  self.class.min_length
end

#saltObject



37
38
39
# File 'lib/hashids_uri.rb', line 37

def salt
  self.class.salt
end

#to_paramObject



52
53
54
# File 'lib/hashids_uri.rb', line 52

def to_param
  hashid
end