Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

gen_eval

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gen_eval

  • 0.4.0
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

gen_eval is a homebrew version of instance_eval that eliminates the most annoying aspect of its use:

For example:

@x = 20
@y = 30
my_image.instance_eval {
    circle @x, @y, 20 
}

=> error @x not initialized

In the above code the programmer means to access the local @x yet instance_eval looks up @x in the receiver (my_image).

gen_eval, on the other hand, works as you'd expect, it looks up @x in the caller-context yet still invokes methods in the receiver-context.

This means we can now do things like this:

@x = 20
@y = 30
image.gen_eval {
    pixel @x, @y
    circle @x, @y, 20 
}

FAQs

Package last updated on 01 Nov 2010

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc