From 7cf4d7dba2e4965a958509bf6685c7227fc6f5fd Mon Sep 17 00:00:00 2001 From: Ismael Celis Date: Thu, 24 Oct 2024 22:26:24 +0100 Subject: [PATCH] Fix docs for #generate --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index b2b1c6c..f838be1 100644 --- a/README.md +++ b/README.md @@ -522,7 +522,7 @@ So, normally you'd only use this attached to primitive types without further pro Passing a proc will evaluate the proc on every invocation. Use this for generated values. ```ruby -random_number = Types::Numeric.static { rand } +random_number = Types::Numeric.generate { rand } random_number.parse # 0.32332 random_number.parse('foo') # 0.54322 etc ``` @@ -530,7 +530,7 @@ random_number.parse('foo') # 0.54322 etc Note that the type of generated value must match the initial step's type, validated at invocation. ```ruby -random_number = Types::String.static { rand } # this won't raise an error here +random_number = Types::String.generate { rand } # this won't raise an error here random_number.parse # raises Plumb::ParseError because `rand` is not a String ```