Class Alias::Creators::AnyToInstanceMethodCreator

  1. lib/alias/creators/any_to_instance_method_creator.rb
Parent: Alias::Creator

Creates instance methods which can call any string of ruby code which ends in a method. This class provides the same functionality that Alias::Creators::ClassToInstanceMethodCreator provides and more but at the cost of less validation. Expects a hash of classes/modules of the instance method mapped to a hash of ruby code strings and the instance method names. For example, the hash {“MyDate”=>{‘Date.today.to_s.gsub’=>’t’}} creates a MyDate.t method which directly calls Date.today.to_s.gsub.