Skip to content

Update documentation to make set behavior a bit clearer#264

Merged
jkowens merged 1 commit intosinatra:masterfrom
twooster:improve-set-documentation
Feb 25, 2020
Merged

Update documentation to make set behavior a bit clearer#264
jkowens merged 1 commit intosinatra:masterfrom
twooster:improve-set-documentation

Conversation

@twooster
Copy link
Copy Markdown
Contributor

This was unclear and tripped us up at work -- we thought set functioned as a memoized deferred-evaluation proc, but that assumption was very, very wrong. This PR updates the documentation to indicate that set with a Proc actually evaluates every time the setting is retrieved, as per https://github.com/sinatra/sinatra/blob/a4dd24add24f2dd0e7299b9e68e12038138294d3/lib/sinatra/base.rb#L1221-L1223

@jkowens jkowens merged commit 8a8c766 into sinatra:master Feb 25, 2020
@jkowens
Copy link
Copy Markdown
Member

jkowens commented Feb 25, 2020

Thanks for the update!

@asaaki
Copy link
Copy Markdown

asaaki commented Feb 25, 2020

That was fast! 😍

@twooster
Copy link
Copy Markdown
Contributor Author

Yow! That was fast! Thanks so much! 💃 💯

@twooster twooster deleted the improve-set-documentation branch February 25, 2020 15:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants