Class: IRB::Command::Howtocall
- Inherits:
-
Base
- Object
- Base
- IRB::Command::Howtocall
- Defined in:
- lib/irbtools/commands/howtocall.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.transform_args(args) ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/irbtools/commands/howtocall.rb', line 10 def transform_args(args) if args.strip =~ /\A(?:([\w:]+)([#.]))?(\w+[?!]?)\z/ if $1 if $2 == "#" "#{$1}, #{$1}.instance_method(:#{$3})" else "#{$1}, :#{$3}" end else ":" + $3 end else args end end |
Instance Method Details
#execute(*args) ⇒ Object
27 28 29 30 31 |
# File 'lib/irbtools/commands/howtocall.rb', line 27 def execute(*args) @irb_context.workspace.binding.send(:howtocall, *args) rescue NameError warn "howtocall: Class or method not found" end |