class XapianDb::DocumentBlueprint::Dependency

Attributes

block[R]
dependent_on[R]
trigger_attributes[R]

Public Class Methods

new(klass_name, trigger_attributes, block) click to toggle source

Constructor @param [String] klass_name Name of the dependent class @param [Array] trigger_attributes List of attributes to watch for changes (if empty, triggers on any change) @option [Block] block Block that is called when changes are detected; the block must return an array of indexeable objects

    # File lib/xapian_db/document_blueprint.rb
464 def initialize(klass_name, trigger_attributes, block)
465   @dependent_on, @trigger_attributes, @block = klass_name, trigger_attributes.map(&:to_s), block
466 end

Public Instance Methods

interested_in?(changed_attrs) click to toggle source
    # File lib/xapian_db/document_blueprint.rb
468 def interested_in?(changed_attrs)
469   return true if @trigger_attributes.empty?
470   (@trigger_attributes & changed_attrs).any?
471 end