Module: GorillaPatch::Inflections

Defined in:
lib/gorilla_patch/inflections.rb

Overview

Inflections

Class Method Summary collapse

Class Method Details

.acronymsObject



6
7
8
# File 'lib/gorilla_patch/inflections.rb', line 6

def self.acronyms
  @acronyms ||= %w[API HTML XML JSON SSL IP HTTP HTTPS]
end

.from_inflectoObject



52
53
54
55
56
# File 'lib/gorilla_patch/inflections.rb', line 52

def self.from_inflecto
  require 'inflecto-refinements'

  Inflecto::Refinements
end

.from_sequelObject



38
39
40
41
42
43
44
45
46
47
48
49
50
# File 'lib/gorilla_patch/inflections.rb', line 38

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