Class: GtkAttributeStorage
- Inherits:
-
Object
- Object
- GtkAttributeStorage
show all
- Includes:
- Eprint, Singleton
- Defined in:
- lib/GtkAttributes.rb
Overview
this file is part of manqod manqod is distributed under the CDDL licence the author of manqod is Dobai-Pataky Balint([email protected])
Constant Summary
Constants included
from Eprint
Eprint::DOMAIN, Eprint::LEVEL
Instance Method Summary
collapse
Methods included from Eprint
#ecode, #edebug, #eerror, #einfo, #enormal, #eprint, #ewarn, #gtk_set_edebug, #set_edebug, #tell_exception
Instance Method Details
#gtk_attribute(gtk_attr, gtk_objectid, gtk_objecttype) ⇒ Object
16
17
18
19
20
|
# File 'lib/GtkAttributes.rb', line 16
def gtk_attribute(gtk_attr, gtk_objectid, gtk_objecttype)
(@gtk_attributes.has_key?(gtk_objectid) ?
( (@gtk_attributes[gtk_objectid].has_key?(gtk_objecttype)) ?
@gtk_attributes[gtk_objectid][gtk_objecttype][gtk_attr] : nil) : nil )
end
|
#load_all ⇒ Object
9
10
11
12
13
|
# File 'lib/GtkAttributes.rb', line 9
def load_all
@gtk_attributes=ManqodDB.instance.cache.get("attributes")
@gtk_attributes=Hash.new unless @gtk_attributes.class.name == "Hash"
einfo("loaded #{@gtk_attributes.size} attributes","main")
end
|
#set_gtk_attribute(gtk_attr, gtk_attr_value, gtkobjectid, gtkobjecttype) ⇒ Object
22
23
24
25
26
27
28
29
|
# File 'lib/GtkAttributes.rb', line 22
def set_gtk_attribute(gtk_attr,gtk_attr_value, gtkobjectid, gtkobjecttype)
@gtk_attributes=Hash.new if @gtk_attributes.nil?
@gtk_attributes[gtkobjectid]=Hash.new unless @gtk_attributes.has_key?(gtkobjectid)
@gtk_attributes[gtkobjectid][gtkobjecttype]=Hash.new unless @gtk_attributes[gtkobjectid].has_key?(gtkobjecttype)
@gtk_attributes[gtkobjectid][gtkobjecttype][gtk_attr]=nil unless @gtk_attributes[gtkobjectid][gtkobjecttype].has_key?(gtk_attr)
@gtk_attributes[gtkobjectid][gtkobjecttype][gtk_attr]=gtk_attr_value
einfo("set attribute [#{gtkobjecttype}][#{gtkobjectid}][#{gtk_attr}]=\"#{gtk_attr_value}\"","main")
end
|
#to_s ⇒ Object
31
|
# File 'lib/GtkAttributes.rb', line 31
def to_s;"GtkAttributeStorage";end
|