Sha256: 3156cf076b9334697b72c58f7c318cdd6c97f2be30d1abb07d95d15eaad31588

Contents?: true

Size: 945 Bytes

Versions: 16

Compression:

Stored size: 945 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 node:
    #
    #   website.ext.item_tracker.add(some_node, :node_content, my_node)
    #
    class NodeContent

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

      def item_id(node) #:nodoc:
        node.alcn
      end

      def item_data(alcn) #:nodoc:
        nil
      end

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

      def referenced_nodes(alcn, nothing) #:nodoc:
        [alcn]
      end

      def item_description(alcn, data) #:nodoc:
        "Content from node <#{alcn}>"
      end

    end

  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
webgen-1.7.3 lib/webgen/item_tracker/node_content.rb
webgen-1.7.2 lib/webgen/item_tracker/node_content.rb
webgen-1.7.1 lib/webgen/item_tracker/node_content.rb
webgen-1.7.0 lib/webgen/item_tracker/node_content.rb
webgen-1.6.0 lib/webgen/item_tracker/node_content.rb
webgen-1.5.2 lib/webgen/item_tracker/node_content.rb
webgen-1.5.1 lib/webgen/item_tracker/node_content.rb
webgen-1.5.0 lib/webgen/item_tracker/node_content.rb
webgen-1.4.1 lib/webgen/item_tracker/node_content.rb
webgen-1.4.0 lib/webgen/item_tracker/node_content.rb
webgen-1.3.0 lib/webgen/item_tracker/node_content.rb
webgen-1.2.1 lib/webgen/item_tracker/node_content.rb
webgen-1.2.0 lib/webgen/item_tracker/node_content.rb
webgen-1.1.0 lib/webgen/item_tracker/node_content.rb
webgen-1.0.0 lib/webgen/item_tracker/node_content.rb
webgen-1.0.0.beta3 lib/webgen/item_tracker/node_content.rb