Skip to content

TOISB provides a wrapper class for dealing with BasicObjects in style!

License

Notifications You must be signed in to change notification settings

acook/that_object_is_so_basic

Repository files navigation

That Object is So Basic!

TOISB lets you play with BasicObject and other weird objects in Ruby in style and without breaking (as many) things.

Gem GitHub Workflow Status (with event) Code Climate maintainability

Usage

Install the gem like gem install that_object_is_so_basic then use it like this:

require "toisb"

# TOISB was originally extracted from the Impasta and Uspec gems
class Impasta < BasicObject; end
spy = Impasta.new

# Wraps any BasicObject or subclass, including normal Objects
toisb = TOISB.wrap spy

toisb.klass #=> Impasta
toisb.superklass #=> BasicObject
tosib.inspector #=> "#<BasicObject/Impasta:0x2b1fcfc70474>"
toisb.singleton #=> #<Class:#<Impasta:0x0000563f9f8e08e8>>
toisb.ancestors #=> [#<Class:#<Impasta:0x0000563f9f8e08e8>>, Impasta, BasicObject]
toisb.safe_send :to_s #=> "#<TestObject:0x00005563c4965d48>"

Author

© 2019-2024 Anthony M. Cook

About

TOISB provides a wrapper class for dealing with BasicObjects in style!

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages