Sha256: b0cc476ba726beaf16993a3bcc6d61128f9d5c067ecfbb3499a5ab85846dfa06
Contents?: true
Size: 481 Bytes
Versions: 4
Compression:
Stored size: 481 Bytes
Contents
# frozen_string_literal: true module ActionPolicy module Ext # Add Module#namespace method module ModuleNamespace refine Module do unless "".respond_to?(:safe_constantize) require "action_policy/ext/string_constantize" using ActionPolicy::Ext::StringConstantize end def namespace return unless name.match?(/[^^]::/) name.sub(/::[^:]+$/, "").safe_constantize end end end end end
Version data entries
4 entries across 4 versions & 1 rubygems