No commit activity in last 3 years
No release in over 3 years
Commonly used utility functions related to reflection
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.14
~> 10.0
~> 3.0
 Project Readme

ReflectionUtils

Commonly used Ruby utility functions related to reflection.

Branch Status
Release Build Status Coverage Status Gem Version Total Downloads
Development Build Status Coverage Status

Features

Functions include:

For usage and examples for each of them take a look at the unit tests.

Another approach would be to include this functionality into classes where its needed. It may be more elegant however moving this functionality into a separate utility class decouples the logic and removes dependency from those classes.

Installation

Add this line to your application's Gemfile:

gem 'reflection_utils'

And then execute:

$ bundle

Or install it yourself as:

$ gem install reflection_utils

Usage

require 'reflection_utils'

# ...

ReflectionUtils.get_bound_instance_method(instance: my_obj, method_name: :my_method)

# etc.

Feedback

Any feedback is much appreciated.

I can only tailor this project to fit use-cases I know about - which are usually my own ones. If you find that this might be the right direction to solve your problem too but you find that it's suboptimal or lacks features don't hesitate to contact me.

Please let me know if you make use of this project so that I can prioritize further efforts.

Development

This gem is developed using Bundler conventions. A good overview can be found here.

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/thisismydesign/reflection_utils.

License

The gem is available as open source under the terms of the MIT License.