Module: YARD::MonkeyPatches

Included in:
Bench::Marks
Defined in:
lib/dsl/monkeypatches.rb

Overview

Monkey patches (🐵) for shorthands.

This module introduces new functionality for creation of some standard classes “samples.” It is used to emulate real data to be passed to automatic benchmarks in cases, when the methods have parameters required.

Examples:

To produce new random String, Hash, Array, Fixnum, one simply calls:

% pry
> require './lib/dsl/monkeypatches'
# ⇒ true
> String.∀ size: 30
# ⇒ "3XсO91Lпр490Rэщ Xза O нL с3VщB"
> Fixnum.∀
# ⇒ 301
> Hash.∀ size: 3
# ⇒ {
#    "aenvxgmsuqhpxgsbhrcjvyvhlrbexa" => "ьюWB4IVачъитяCи жH3O 8илыP Dц Kх",
#   "awohozdxdjzvombswswsfzsqfqfguxc" => 202,
#     "befqyvqhmrncboilgdjwbqpyvfgtp" => "ифMцGSь фъ BубITмPэIHрTJлъ9OдJщ9"
# }
> Array.∀ size: 3
# ⇒ [
#   [0] " эвъуL P 5июоCXъXе AB0 й1DьUфв",
#   [1] 800,
#   [2] 851
# ]

Author: