https://github.com/acook/introspection
Does a deep inspection on the structure of Ruby objects.
https://github.com/acook/introspection
data-exploration introspection object-inspector reflection ruby
Last synced: 12 months ago
JSON representation
Does a deep inspection on the structure of Ruby objects.
- Host: GitHub
- URL: https://github.com/acook/introspection
- Owner: acook
- License: apache-2.0
- Created: 2013-03-26T19:13:36.000Z (about 13 years ago)
- Default Branch: master
- Last Pushed: 2016-12-05T16:36:55.000Z (over 9 years ago)
- Last Synced: 2023-03-11T04:13:01.862Z (over 3 years ago)
- Topics: data-exploration, introspection, object-inspector, reflection, ruby
- Language: Ruby
- Homepage:
- Size: 36.1 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.markdown
- License: LICENSE
Awesome Lists containing this project
README
Introspect
==========
Tools for exploring Ruby's objects!
Basic Usage
-----------
```ruby
require 'introspect/core_ext' # the core extensions are OPTIONAL but handy
my_object.introspect
```
Tools Available
---------------
### CONTENTS
Tells you all about the object and the objects inside it.
```ruby
require 'introspect'
Introspect.introspect my_object, :contents
```
example
```ruby
[1,2,3].introspect :contents
```
output
```ruby
{
[1, 2, 3]=>
{
:class=>Array,
:ancestors=>
[
Array,
Enumerable,
Object,
PP::ObjectMixin,
Introspect,
Kernel,
BasicObject
]
}
}
```
### WHICH
Tells you which object a method is defined on.
```ruby
require 'introspect'
Introspect.introspect my_object, :which, :method_name
```
example
```ruby
[1,2,3].introspect :which, :cycle
```
output
```ruby
Array
```
Contributing
------------
Bug reports and pull requests are welcome on GitHub at https://github.com/acook/introspection.
> © Anthony M. Cook 2012-2016