lib/ventable.rb in ventable-1.2.0 vs lib/ventable.rb in ventable-1.3.1
- old
+ new
@@ -1,10 +1,11 @@
+# frozen_string_literal: true
+
require 'ventable/version'
require 'ventable/event'
module Ventable
-
def self.disable
@disabled = true
end
def self.enable
@@ -16,12 +17,12 @@
end
end
class String
def underscore
- self.gsub(/::/, '/').
- gsub(/([A-Z]+)([A-Z][a-z])/, '\1_\2').
- gsub(/([a-z\d])([A-Z])/, '\1_\2').
- tr('-', '_').
- downcase
+ gsub("::", '/').
+ gsub(/([A-Z]+)([A-Z][a-z])/, '\1_\2').
+ gsub(/([a-z\d])([A-Z])/, '\1_\2').
+ tr('-', '_').
+ downcase
end
end