Class: Tcl::ArrayVar

Inherits:
Var
  • Object
show all
Defined in:
lib/tcl/var.rb

Constant Summary

Constants inherited from Var

Var::BUILTINS

Instance Attribute Summary

Attributes inherited from Var

#name

Instance Method Summary collapse

Methods inherited from Var

#builtin?, find, #initialize

Methods included from Delegator

included, #method_missing, #respond_to_missing?

Methods included from Utils

#_, #_!

Constructor Details

This class inherits a constructor from Tcl::Var

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Tcl::Delegator

Instance Method Details

#to_aObject



55
56
57
# File 'lib/tcl/var.rb', line 55

def to_a
  value.split.each_slice(2).to_a
end

#to_hObject



59
60
61
# File 'lib/tcl/var.rb', line 59

def to_h
  to_a.to_h
end

#to_tclObject



51
52
53
# File 'lib/tcl/var.rb', line 51

def to_tcl
  _(:array, :set, name, value)
end

#valueObject



47
48
49
# File 'lib/tcl/var.rb', line 47

def value
  _!(:array, :get, name)
end