module Trusty::Utilities::MethodNameExtensions

Public Class Methods

included(base) click to toggle source
# File lib/trusty/utilities/method_name_extensions.rb, line 7
def self.included(base)
  base.extend self
end

Public Instance Methods

method_missing(name, *args, &block) click to toggle source

dynamically add methods that forward to config

Calls superclass method
# File lib/trusty/utilities/method_name_extensions.rb, line 17
def method_missing(name, *args, &block)
  method_name = method_name_info(name)
  
  if method_name.define_for(self)
    method_name.value_for(self)
  else
    super
  end
end
method_name_info(method_name) click to toggle source
# File lib/trusty/utilities/method_name_extensions.rb, line 11
def method_name_info(method_name)
  @method_name_info ||= {}
  @method_name_info[method_name.to_s] ||= MethodName.new(method_name)
end