Skip to content

Programming is an art

blog-logo

Josh Software

Tag: eval

Eval method in ruby

February 16, 2010April 16, 2010 by sandipransing, posted in Ruby

Eval method in ruby executes string/expression passed as parameter.Example:ree-1.8.7-2010.01 > eval("5+3") => 8 ree-1.8.7-2010.01 > eval("a=5") => 5 ree-1.8.7-2010.01 > eval("b||=a") => 5 Its part of ruby meta-programming and not recommended approach unless there is no any alternative to do.

Tagged eval, RubyLearningLeave a comment

Categories

Android Artificial Intelligence CMS Conferences Frontend Development General Go Javascript Mobile Development Radiant React Ruby Ruby on Rails Search Tutorials

Archives

Authors

Our Publications

Hands-on Microservices with Go and MongoDB
Hands-on Microservices with Go and MongoDB
Learning Mongoid - Gautam Rege
Learning Mongoid
Create a website or blog at WordPress.com
  • Follow Following
    • Josh Software
    • Join 209 other followers
    • Already have a WordPress.com account? Log in now.
    • Josh Software
    • Customize
    • Follow Following
    • Sign up
    • Log in
    • Report this content
    • View site in Reader
    • Manage subscriptions
    • Collapse this bar