Class: TkDatabaseClass
Constant Summary
Constants inherited from TkBindTag
TkBindTag::ALL, TkBindTag::BTagID_TBL
Class Method Summary collapse
-
.new(name, *args, &b) ⇒ Object
def self.new(name, *args, &b) BTagID_TBL.mutex.synchronize{ return BTagID_TBL if BTagID_TBL } super(name, *args, &b) end.
Instance Method Summary collapse
-
#initialize(name, *args, &b) ⇒ TkDatabaseClass
constructor
A new instance of TkDatabaseClass.
- #inspect ⇒ Object
Methods inherited from TkBindTag
id2obj, #name, new_by_name, #to_eval
Methods included from TkBindCore
#bind, #bind_append, #bind_remove, #bindinfo
Constructor Details
#initialize(name, *args, &b) ⇒ TkDatabaseClass
Returns a new instance of TkDatabaseClass.
129 130 131 132 |
# File 'lib/tk/bindtag.rb', line 129 def initialize(name, *args, &b) @id = name bind(*args, &b) if args != [] end |
Class Method Details
.new(name, *args, &b) ⇒ Object
def self.new(name, *args, &b)
BTagID_TBL.mutex.synchronize{
return BTagID_TBL[name] if BTagID_TBL[name]
}
super(name, *args, &b)
end
def initialize(name, *args, &b)
@id = name
BTagID_TBL.mutex.synchronize{
BTagID_TBL[@id] = self
}
bind(*args, &b) if args != []
end
116 117 118 119 120 121 122 123 124 125 126 127 |
# File 'lib/tk/bindtag.rb', line 116 def self.new(name, *args, &b) BTagID_TBL.mutex.synchronize{ if BTagID_TBL[name] BTagID_TBL[name] else BTagID_TBL[name] = self.allocate.instance_eval{ initialize(name, *args, &b) self } end } end |
Instance Method Details
#inspect ⇒ Object
134 135 136 137 |
# File 'lib/tk/bindtag.rb', line 134 def inspect #Kernel.format "#<TkDatabaseClass: %s>", @id '#<TkDatabaseClass: ' + @id + '>' end |