# Storing Ruby expressions to execute later

**URL:** <https://www.ruby-forum.com/t/storing-ruby-expressions-to-execute-later/170051>\
**Category:** Rails\
**Created:** [June 11, 2009, 6:26pm UTC](https://www.ruby-forum.com/t/storing-ruby-expressions-to-execute-later/170051 "2009-06-11T18:26:02Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![tashfeen.ekram](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/3ab097/32.png) [@tashfeen.ekram](https://www.ruby-forum.com/u/tashfeen.ekram)\
**Post date:** [June 11, 2009, 6:26pm UTC](https://www.ruby-forum.com/t/storing-ruby-expressions-to-execute-later/170051/1 "2009-06-11T18:26:02Z")

</div>

Is there a way to store rb expression so that can be interpreted  
later. For example, i store as a string for example in my db “3+2” and  
then at a later time i would like to execute it at future time. I am  
allowing my users to generate code to analyze data and would like to  
be able to allow the users to generate whatever expressions they see  
fit. the actual expressino will be more complex but that is just an  
example.

thanks,  
tashfeen

---

<div class="post-metadata">

**Author:** ![tashfeen.ekram](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/3ab097/32.png) [@tashfeen.ekram](https://www.ruby-forum.com/u/tashfeen.ekram)\
**Post date:** [June 11, 2009, 6:28pm UTC](https://www.ruby-forum.com/t/storing-ruby-expressions-to-execute-later/170051/2 "2009-06-11T18:28:24Z")

</div>

On Thu, Jun 11, 2009 at 6:12 PM,  
tashfeen.ekram[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Is there a way to store rb expression so that can be interpreted  
> later. For example, i store as a string for example in my db “3+2” and  
> then at a later time i would like to execute it at future time. I am  
> allowing my users to generate code to analyze data and would like to  
> be able to allow the users to generate whatever expressions they see  
> fit. the actual expressino will be more complex but that is just an  
> example.

Can you trust your users? Can you be confident they won’t put  
“User.delete\_all” as Ruby code?
