Sha256: c553ccf384b4c86ec1f82d1179ed31bb5d07a4bc0f61e8cc8e8fefe7e8452e5e
Contents?: true
Size: 819 Bytes
Versions: 2
Compression:
Stored size: 819 Bytes
Contents
# encoding: utf-8 module Veritas # A mixin to allow inheritable aliases for methods to be added module Aliasable # Create aliases for each specified method # # @example # inheritable_alias(:- => :difference) # # @param [Hash{Symbol => Symbol}] aliases # the new and old methods to alias # # @return [self] # # @api public def inheritable_alias(aliases) aliases.each do |new_method, original_method| class_eval <<-RUBY, __FILE__, __LINE__ + 1 def #{new_method}(*args, &block) # def |(*args, &block) self.#{original_method}(*args, &block) # self.union(*args, &block) end # end RUBY end self end end # module Aliasable end # module Veritas
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
veritas-0.0.5 | lib/veritas/support/aliasable.rb |
veritas-0.0.4 | lib/veritas/support/aliasable.rb |