Module: Distribution::Shorthand
- Defined in:
- lib/distribution.rb
Constant Summary collapse
- EQUIVALENCES =
{ p_value: :p, cdf: :cdf, pdf: :pdf, rng: :r, exact_pdf: :epdf, exact_cdf: :ecdf, exact_p_value: :ep }
Class Method Summary collapse
Class Method Details
.add_shortcut(shortcut, method, &block) ⇒ Object
49 50 51 52 53 54 55 56 57 58 |
# File 'lib/distribution.rb', line 49 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 |