| 1 |
# mruby-method |
| 2 |
|
| 3 |
An implementation of class **Method** and **UnboundMethod** for mruby |
| 4 |
|
| 5 |
```ruby |
| 6 |
p Enumerable.instance_method(:find_all).source_location |
| 7 |
#=> ["mruby/mruby/mrblib/enum.rb", 148] |
| 8 |
``` |
| 9 |
|
| 10 |
# Note |
| 11 |
|
| 12 |
You need to enable debug option in your build configuration to use |
| 13 |
`source_location` method in this gem, for example: |
| 14 |
|
| 15 |
```ruby |
| 16 |
MRuby::Build.new do |conf| |
| 17 |
conf.enable_debug |
| 18 |
end |
| 19 |
``` |
| 20 |
|
| 21 |
# Supported Methods |
| 22 |
|
| 23 |
## Kernel |
| 24 |
|
| 25 |
- `Kernel#method` |
| 26 |
- `Kernel#singleton_method` |
| 27 |
|
| 28 |
## Module |
| 29 |
|
| 30 |
- `Module#instance_method` |
| 31 |
|
| 32 |
## Method class |
| 33 |
|
| 34 |
- `Method#name` |
| 35 |
- `Method#call` |
| 36 |
- `Method#super_method` |
| 37 |
- `Method#arity` |
| 38 |
- `Method#unbind` |
| 39 |
- `Method#[]` |
| 40 |
- `Method#owner` |
| 41 |
- `Method#receiver` |
| 42 |
- `Method#parameters` |
| 43 |
- `Method#source_location` |
| 44 |
- `Method#to_proc` |
| 45 |
|
| 46 |
## UnboundMethod class |
| 47 |
|
| 48 |
- `UnboundMethod#name` |
| 49 |
- `UnboundMethod#bind` |
| 50 |
- `UnboundMethod#super_method` |
| 51 |
- `UnboundMethod#arity` |
| 52 |
- `UnboundMethod#owner` |
| 53 |
- `UnboundMethod#parameters` |
| 54 |
- `UnboundMethod#source_location` |
| 55 |
|
| 56 |
# See also |
| 57 |
|
| 58 |
- <https://ruby-doc.org/core-2.3.3/Method.html> |
| 59 |
- <https://ruby-doc.org/core-2.3.3/UnboundMethod.html> |