class Archlinux::AurQueryCache
Attributes
info_cache[RW]
search_cache[RW]
Public Class Methods
new(*args,**kwds)
click to toggle source
Calls superclass method
Archlinux::AurQueryCustom::new
# File lib/aur/aur_rpc.rb, line 146 def initialize(*args,**kwds) super @search_cache={} @info_cache={} end
Public Instance Methods
infos(*pkgs, slice: 150)
click to toggle source
Calls superclass method
Archlinux::AurQueryCustom#infos
# File lib/aur/aur_rpc.rb, line 163 def infos(*pkgs, slice: 150) got = pkgs & @info_cache.keys pkgs = pkgs - got res=super(*pkgs, slice: slice) res.each do |pkg| @info_cache[pkg["Name"]]=pkg end pkgs.each do |name| @info_cache[name]||=nil #missing packages end @info_cache.values_at(*got, *pkgs).compact end
search(arg, by: nil)
click to toggle source
Calls superclass method
Archlinux::AurQueryCustom#search
# File lib/aur/aur_rpc.rb, line 152 def search(arg, by: nil) r={type: "search", arg: arg} r[:by]=by if by if @search_cache.key?(r) @search_cache[r] else res=super res end end