Sha256: dd0ad6755440fda449789f2b4cd285f80c017ace907d4380707ce8a7c294335d

Contents?: true

Size: 877 Bytes

Versions: 1

Compression:

Stored size: 877 Bytes

Contents

# -*- encoding: utf-8 -*-

require 'webgen/item_tracker'

module Webgen
  class ItemTracker

    # This class is used to track changes to the content of a node. The content of a node is changed
    # if any of its dependencies are changed.
    #
    # The item for this tracker is the alcn of the node:
    #
    #   website.ext.item_tracker.add(some_node, :node_content, my_node.alcn)
    #
    class NodeContent

      def initialize(website) #:nodoc:
        @website = website
      end

      def item_id(alcn) #:nodoc:
        alcn
      end

      def item_data(alcn) #:nodoc:
        nil
      end

      def changed?(alcn, old_data) #:nodoc:
        @website.tree[alcn].nil? || @website.ext.item_tracker.node_changed?(@website.tree[alcn])
      end

      def node_referenced?(alcn, nothing, node_alcn) #:nodoc:
        alcn == node_alcn
      end

    end

  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
webgen-1.0.0.beta1 lib/webgen/item_tracker/node_content.rb