Class: Fzeet::Handle
- Inherits:
-
Object
show all
- Defined in:
- lib/fzeet/Common.rb
Direct Known Subclasses
AcceleratorTable, BasicWindow, ClientDC, CommonDialog, Control, IndirectFont, Menu, PARGB32, PopupMenu, SystemBrush, SystemCursor, SystemIcon
Constant Summary
collapse
- @@instances =
{}
Instance Attribute Summary collapse
Class Method Summary
collapse
Instance Method Summary
collapse
Instance Attribute Details
#handle ⇒ Object
Returns the value of attribute handle.
179
180
181
|
# File 'lib/fzeet/Common.rb', line 179
def handle
@handle
end
|
Class Method Details
.instance(handle) ⇒ Object
169
|
# File 'lib/fzeet/Common.rb', line 169
def self.instance(handle) raise "#{self}.#{__method__} failed." unless (instance = @@instances[handle.to_i]); instance end
|
.instance?(handle) ⇒ Boolean
168
|
# File 'lib/fzeet/Common.rb', line 168
def self.instance?(handle) @@instances.include?(handle.to_i) end
|
.wrap(handle, iface) ⇒ Object
171
172
173
174
175
176
177
|
# File 'lib/fzeet/Common.rb', line 171
def self.wrap(handle, iface)
Object.new.tap { |o|
o.instance_variable_set(:@handle, handle)
o.class.send(:attr_reader, :handle)
o.class.send(:include, iface)
}
end
|
Instance Method Details
#attach ⇒ Object
181
|
# File 'lib/fzeet/Common.rb', line 181
def attach; @@instances[@handle.to_i] = self end
|
#detach ⇒ Object
182
|
# File 'lib/fzeet/Common.rb', line 182
def detach; @@instances.delete(@handle.to_i) end
|
#dup ⇒ Object
184
|
# File 'lib/fzeet/Common.rb', line 184
def dup; raise "#{self}.#{__method__} is not implemented." end
|