Repository is archived
No release in over 3 years
Low commit activity in last 3 years
Enhance delegate method by prefixed option
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
 Dependencies

Development

~> 1.17
~> 10.0
~> 3.0

Runtime

 Project Readme

PrefixedDelegation

Enhance ActiveSupport's delegate method to allow prefixed option.

Installation

gem 'prefixed_delegation'

Usage

# Defines account_name with lesser greppability.
delegate :name, to: :user, prefix: :account

# Defines account_name with greppability and some redundancy.
delegate :account_name, to: :user, prefixed: :account

# And also works with prefixed: true.
delegate :user_name, to: :user, prefixed: true

Contributing

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

License

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