https://github.com/tadd/binding_self
Binding#self to extract self of the binding
https://github.com/tadd/binding_self
Last synced: over 1 year ago
JSON representation
Binding#self to extract self of the binding
- Host: GitHub
- URL: https://github.com/tadd/binding_self
- Owner: tadd
- License: other
- Created: 2014-11-22T00:39:02.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2014-12-27T11:22:14.000Z (over 11 years ago)
- Last Synced: 2025-01-22T09:33:22.433Z (over 1 year ago)
- Language: C
- Homepage:
- Size: 176 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: COPYING
Awesome Lists containing this project
README
# Binding#self
Binding#self to extract self of the binding.
## Installation
Add this line to your application's Gemfile:
```ruby
gem 'binding_self'
```
And then execute:
$ bundle
Or install it yourself as:
$ gem install binding_self
## Usage
```ruby
require 'binding_self'
class Foo
def initialize(a)
@ivar = a
end
def binding
::Kernel.binding
end
end
foo = Foo.new(2)
foo.binding.self #=> #
foo.binding.self.instance_eval { @ivar } #=> 2
```
## Contributing
1. Fork it ( https://github.com/tadd/binding_self/fork )
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Add some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create a new Pull Request!
## License
Ruby's. See COPYING and BSDL.