Module: Hornetseye::ReaderConversion

Defined in:
lib/multiarray/shortcuts.rb

Overview

Module with meta-programming methods for creating shortcut methods for reading images

Class Method Summary collapse

Class Method Details

.read_shortcut(target) ⇒ Proc

Meta-programming method for creating shortcut methods for reading images

Parameters:

  • target (Class)

    Element-type to create read method for.

Returns:

  • (Proc)

    The new method.



126
127
128
129
130
# File 'lib/multiarray/shortcuts.rb', line 126

def read_shortcut( target )
  define_method "read_#{target.to_s.downcase}" do
    read.to_type target
  end
end