Module: Hornetseye::MultiArrayConversion

Defined in:
lib/multiarray/shortcuts.rb

Overview

Module with meta-programming methods for creating conversion shortcut methods

Class Method Summary collapse

Class Method Details

.to_type_shortcut(target) ⇒ Proc

Meta-programming method for creating type conversion shortcut methods

Parameters:

  • target (Class)

    Element-type to create type conversion shortcut for.

Returns:

  • (Proc)

    The new method.



79
80
81
82
83
# File 'lib/multiarray/shortcuts.rb', line 79

def to_type_shortcut( target )
  define_method "to_#{target.to_s.downcase}" do
    to_type target
  end
end