Sha256: 10480055b44bbe8460e09796f27252a8a5ea297955eb244adffdc85dca067165
Contents?: true
Size: 825 Bytes
Versions: 17
Compression:
Stored size: 825 Bytes
Contents
module CiteProc module Ruby class Renderer class ItemObserver attr_accessor :history, :item def initialize(item, history = {}) @item, @history = item, history end def start item.add_observer(self) self end def stop item.delete_observer(self) self end def update(method, key, value) history[key] = value if method == :read end def skip? !history.empty? && history.values.all? { |v| v.nil? || v.respond_to?(:empty?) && v.empty? } end def accessed history.select { |key, value| !value.nil? }.keys end def clear! history.clear self end end end end end
Version data entries
17 entries across 17 versions & 1 rubygems