Sha256: 809dd2b299b2310f9b376329078796579f21aed462db9dde9138cf1391f06eaf

Contents?: true

Size: 476 Bytes

Versions: 1

Compression:

Stored size: 476 Bytes

Contents

# Provides full name aliases for Dfect's default abbreviated vocabulary.

require 'dfect'

module Dfect
  full_names = {
    'D' => 'Describe',
    'T' => 'True',
    'F' => 'False',
    'E' => 'Error',
    'C' => 'Catch',
    'S' => 'Share',
    'L' => 'Log',
  }

  instance_methods(false).each do |meth_name|
    if full_name = meth_name.to_s.sub!(/^[A-Z]/) {|abbr| full_names[abbr] }
      alias_method full_name, meth_name
    end
  end

  # for hooks
  Describe = D
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
dfect-2.2.0 lib/dfect/full.rb