https://github.com/envygeeks/forwardable-extended
:muscle: Extends forwardable with delegation to hashes and instance variables.
https://github.com/envygeeks/forwardable-extended
delegation forwardable ruby stdlib stdlib-replacement
Last synced: 9 days ago
JSON representation
:muscle: Extends forwardable with delegation to hashes and instance variables.
- Host: GitHub
- URL: https://github.com/envygeeks/forwardable-extended
- Owner: envygeeks
- License: mit
- Created: 2016-01-08T22:18:15.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2016-04-06T22:03:30.000Z (about 9 years ago)
- Last Synced: 2025-04-10T00:01:27.079Z (13 days ago)
- Topics: delegation, forwardable, ruby, stdlib, stdlib-replacement
- Language: Ruby
- Homepage:
- Size: 35.2 KB
- Stars: 4
- Watchers: 1
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[][travis]
[][coverage]
[][codeclimate]
[][gemnasium][gemnasium]: https://gemnasium.com/envygeeks/forwardable-extended
[codeclimate]: https://codeclimate.com/github/envygeeks/forwardable-extended
[coverage]: https://codeclimate.com/github/envygeeks/forwardable-extended/coverage
[travis]: https://travis-ci.org/envygeeks/forwardable-extended# Forwardable Extended
Provides more `Forwardable` methods for your source as `Forwardable::Extended`.
```ruby
class MyClass
rb_delegate :method_name, :to => :@ivar, :type => :ivar, :boolean => true
rb_delegate :method_name, :to => :@ivar, :type => :ivar, :boolean => :reverse
rb_delegate :method_name, :to => :hash, :type => :hash, :key => :the_key
rb_delegate :method_name_is_key, :to => :hash, :type => :hash
end
```* Any delegation can accept `alias_of` which will be the message sent to the object.
* You can send arguments by attaching the keyword `:args => [:my_arg]`, these are sent a `#to_s` message.
* Any delegation can be boolean if you wish it to be, even `:reverse`.