Sha256: 08ba1dd3de69de0c46dc6c5828bea68c7ed5f6fabf4746f48395e1b4e4c04b1a

Contents?: true

Size: 481 Bytes

Versions: 1

Compression:

Stored size: 481 Bytes

Contents

module Distribution
  module Shorthand
    EQUIVALENCES = { p_value: :p, cdf: :cdf, pdf: :pdf, rng: :r,
                     exact_pdf: :epdf, exact_cdf: :ecdf, exact_p_value: :ep }

    def self.add_shortcut(shortcut, method, &block)
      if EQUIVALENCES.include? method.to_sym
        name = shortcut + "_#{method}"
        define_method(name, &block)

        name = shortcut + "_#{EQUIVALENCES[method.to_sym]}"
        define_method(name, &block)

      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
distribution-0.8.0 lib/distribution/shorthand.rb