module Hashid::Rails
Constants
- HASHID_TOKEN
Arbitrary value to verify hashid en.wikipedia.org/wiki/Phrases_from_The_Hitchhiker%27s_Guide_to_the_Galaxy#On_the_Internet_and_in_software
- VERSION
Public Class Methods
configuration()
click to toggle source
Get configuration or load defaults
# File lib/hashid/rails.rb, line 19 def self.configuration @configuration ||= Configuration.new end
configure() { |configuration| ... }
click to toggle source
Set configuration settings with a block
# File lib/hashid/rails.rb, line 24 def self.configure yield(configuration) end
included(base)
click to toggle source
# File lib/hashid/rails.rb, line 14 def self.included(base) base.extend ClassMethods end
reset()
click to toggle source
Reset gem configuration to defaults
# File lib/hashid/rails.rb, line 29 def self.reset @configuration = Configuration.new end
Public Instance Methods
hashid()
click to toggle source
# File lib/hashid/rails.rb, line 33 def hashid self.class.encode_id(id) end
to_param()
click to toggle source
Calls superclass method
# File lib/hashid/rails.rb, line 37 def to_param self.class.hashid_configuration.override_to_param ? hashid : super end