class Sys::Proc::Helper::Inflector

Inflector built on top of “Dry::Inflector“

Public Class Methods

new() click to toggle source
# File lib/sys/proc/helper/inflector.rb, line 13
def initialize
  require 'dry/inflector'

  @inflector = Dry::Inflector.new
end

Public Instance Methods

method_missing(method, *args, &block) click to toggle source
Calls superclass method
# File lib/sys/proc/helper/inflector.rb, line 29
def method_missing(method, *args, &block)
  if respond_to_missing?(method)
    @inflector.public_send(method, *args, &block)
  else
    super
  end
end
resolve(loadable) click to toggle source

Load constant from a loadable/requirable path

@param [String] loadable @return [Object]

# File lib/sys/proc/helper/inflector.rb, line 23
def resolve(loadable)
  require loadable

  @inflector.constantize(@inflector.classify(loadable))
end
respond_to_missing?(method, include_private = false) click to toggle source
Calls superclass method
# File lib/sys/proc/helper/inflector.rb, line 37
def respond_to_missing?(method, include_private = false)
  return true if @inflector.respond_to?(method, include_private)

  super(method, include_private)
end