Class: TkNamespace::Ensemble

Class | TkNamespace::Ensemble
In: | tk/lib/tk/namespace.rb
Parent: | TkObject

### Methods

cget configinfo exist? exists? new

### Public Class methods

exist?(ensemble)

[Source]

    # File tk/lib/tk/namespace.rb, line 44
        def self.exist?(ensemble)
          bool(tk_call('namespace', 'ensemble', 'exists', ensemble))
        end

new(keys = {})

[Source]

    # File tk/lib/tk/namespace.rb, line 48
        def initialize(keys = {})
          @ensemble = @path = tk_call('namespace', 'ensemble', 'create', keys)
        end

### Public Instance methods

cget(slot)

[Source]

    # File tk/lib/tk/namespace.rb, line 52
        def cget(slot)
          if slot == :namespace || slot == 'namespace'
            ns = super(slot)
            if TkNamespace::Tk_Namespace_ID_TBL.key?(ns)
              TkNamespace::Tk_Namespace_ID_TBL[ns]
            else
              ns
            end
          else
            super(slot)
          end
        end

configinfo(slot = nil)

[Source]

    # File tk/lib/tk/namespace.rb, line 65
        def configinfo(slot = nil)
          if slot
            if slot == :namespace || slot == 'namespace'
              val = super(slot)
              if TkNamespace::Tk_Namespace_ID_TBL.key?(val)
                val = TkNamespace::Tk_Namespace_ID_TBL[val]
              end
            else
              val = super(slot)
            end

            if TkComm::GET_CONFIGINFO_AS_ARRAY
              [slot.to_s, val]
            else # ! TkComm::GET_CONFIGINFO_AS_ARRAY
              {slot.to_s => val}
            end

          else
            info = super()

            if TkComm::GET_CONFIGINFO_AS_ARRAY
              info.map!{|inf|
                if inf[0] == 'namespace' &&
                    TkNamespace::Tk_Namespace_ID_TBL.key?(inf[-1])
                  [inf[0], TkNamespace::Tk_Namespace_ID_TBL[inf[-1]]]
                else
                  inf
                end
              }
            else # ! TkComm::GET_CONFIGINFO_AS_ARRAY
              val = info['namespace']
              if TkNamespace::Tk_Namespace_ID_TBL.key?(val)
                info['namespace'] = TkNamespace::Tk_Namespace_ID_TBL[val]
              end
            end

            info
          end
        end

exists?()

[Source]

    # File tk/lib/tk/namespace.rb, line 105
        def exists?
          bool(tk_call('namespace', 'ensemble', 'exists', @path))
        end

[Validate]