Sha256: 701e246708a3fe86dc4f7553ec2fcefe55f6c964092d70d2f9f06a97ed4d81c0
Contents?: true
Size: 651 Bytes
Versions: 11
Compression:
Stored size: 651 Bytes
Contents
module Nyauth module ClientConcern extend ActiveSupport::Concern included do |base| helper_method :client_class helper_method :client_name end def initialize @client_classes = {} super end private def mounted_path request.script_name.presence || "/#{request.path.split('/').try(:second)}" end # specify client class from mounted_path def client_class @client_classes[mounted_path] ||= mounted_path[1..-1].classify.constantize rescue @client_classes[mounted_path] = User end def client_name client_class.name.underscore.to_sym end end end
Version data entries
11 entries across 11 versions & 1 rubygems