lib/tram/policy/inflector.rb in tram-policy-0.2.0 vs lib/tram/policy/inflector.rb in tram-policy-0.2.1

- old
+ new

@@ -1,10 +1,13 @@ class Tram::Policy if Object.const_defined? "ActiveSupport::Inflector" + # @private Inflector = ActiveSupport::Inflector elsif Object.const_defined? "Inflecto" + # @private Inflector = ::Inflecto else + # @private module Inflector def self.underscore(name) name&.dup&.tap do |n| n.gsub!(/([A-Z]+)([A-Z][a-z])/, '\1_\2') n.gsub!(/([a-z\d])([A-Z])/, '\1_\2')