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

transfigure

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

transfigure

  • 1.0.0
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

transfigure

An experimental Ruby native extension that allows changing an object's class at runtime.

Installation

gem install transfigure

Usage

require 'transfigure'

The transfigure gem adds the transfigure_into! method onto Ruby's Object class. Pass it another class to switch out the object's current class to another one:

class Foo
end

class Bar
end

obj = Foo.new
obj.is_a?(Foo) # => true
obj.transfigure_into!(Bar)
obj.is_a?(Foo) # => false
obj.is_a?(Bar) # => true

Requirements

The code has only been tested on MRI (cruby) 3.1 and will definitely not work on other Ruby engines like JRuby or TruffleRuby.

Running Tests

bundle exec rspec

Authors

  • Cameron C. Dutro: http://github.com/camertron

FAQs

Package last updated on 11 Jun 2023

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