module HasChecksum::PORO

Private Instance Methods

define_methods(calculator, source, options) click to toggle source
# File lib/has_checksum.rb, line 112
def define_methods(calculator, source, options)
  klass = options[:algorithm]
  if klass.respond_to?(:call)
    define_method(options[:method]) { klass[digest_string(source)] }
  else
    define_method(options[:method]) { send(calculator, klass, digest_string(source), options) }
  end
end