Module: Tcl::InterpHelper

Included in:
Interp, Proc, Var
Defined in:
lib/tcl/interp_helper.rb

Class Method Summary collapse

Instance Method Summary collapse

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(name, *args, &block) ⇒ Object



17
18
19
20
21
22
23
# File 'lib/tcl/interp_helper.rb', line 17

def method_missing(name, *args, &block)
  if interp.respond_to?(name)
    interp.send(name, *args, &block)
  else
    super
  end
end

Class Method Details

.included(klass) ⇒ Object



3
4
5
6
7
# File 'lib/tcl/interp_helper.rb', line 3

def self.included(klass)
  klass.class_eval do
    attr_reader :interp
  end
end

Instance Method Details

#_(*args) ⇒ Object



9
10
11
# File 'lib/tcl/interp_helper.rb', line 9

def _(*args)
  interp.array_to_list(args)
end

#_!(*args) ⇒ Object



13
14
15
# File 'lib/tcl/interp_helper.rb', line 13

def _!(*args)
  interp.eval(_(*args))
end