Module: GorillaPatch::Inflections

Defined in:
lib/gorilla-patch/inflections.rb

Overview

Inflections

Class Method Summary collapse

Class Method Details

.from_inflectoObject



42
43
44
45
46
# File 'lib/gorilla-patch/inflections.rb', line 42

def self.from_inflecto
	require 'inflecto-refinements'

	Inflecto::Refinements
end

.from_sequelObject



28
29
30
31
32
33
34
35
36
37
38
39
40
# File 'lib/gorilla-patch/inflections.rb', line 28

def self.from_sequel
	@from_sequel ||= Module.new do
		require 'sequel'

		refine String do
			Sequel::Inflections.private_instance_methods.each do |method|
				define_method method do
					Sequel::Inflections.instance_method(method).bind(self).call(self)
				end
			end
		end
	end
end