Class: Alias::Creators::AnyToInstanceMethodCreator

Inherits:
Alias::Creator show all
Defined in:
lib/alias/creators/any_to_instance_method_creator.rb

Overview

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“MyDate”=>{‘Date.today“MyDate”=>{‘Date.today.to_s“MyDate”=>{‘Date.today.to_s.gsub’=>‘t’} creates a MyDate.t method which directly calls Date.today.to_s.gsub.

Instance Attribute Summary

Attributes inherited from Alias::Creator

#aliases, #force, #verbose

Method Summary

Methods inherited from Alias::Creator

class_or_module, #create, creators, #delete_invalid_aliases, generate, generates_aliases, inherited, #initialize, map, maps_config, valid, validators

Constructor Details

This class inherits a constructor from Alias::Creator