class DrbImages

this file is part of manqod manqod is distributed under the CDDL licence the owner of manqod is Dobai-Pataky Balint(dpblnt@gmail.com)

Attributes

drbdb[R]
images[R]

Public Class Methods

new(drbdb) click to toggle source
# File lib/DrbDB/DrbImages.rb, line 8
def initialize(drbdb)
        @drbdb=drbdb
        @images=Hash.new
end

Public Instance Methods

get_image(image_id) click to toggle source
# File lib/DrbDB/DrbImages.rb, line 29
def get_image(image_id)
        @images[image_id.to_i]
end
keys() click to toggle source
# File lib/DrbDB/DrbImages.rb, line 32
def keys
        @images.keys
end
load_all() click to toggle source
# File lib/DrbDB/DrbImages.rb, line 15
def load_all
        @keys=Hash.new
        begin
        drbdb.admin.rows("select * from images").each{|row|
                @images[row["id"].to_i]=row
                @drbdb.cache.set("im[#{row["id"]}]",row)
                @keys[row["id"].to_i]="im[#{row["id"]}]"
        }
        rescue => err
        end
        @drbdb.cache.set("imkeys",@keys)
        einfo("#{@images.size} images")
        self
end
to_s() click to toggle source
# File lib/DrbDB/DrbImages.rb, line 35
def to_s
        "Images of #{drbdb}"
end