Class: XapianDb::DocumentBlueprint::Dependency
- Inherits:
-
Object
- Object
- XapianDb::DocumentBlueprint::Dependency
- Defined in:
- lib/xapian_db/document_blueprint.rb
Instance Attribute Summary collapse
-
#block ⇒ Object
readonly
Returns the value of attribute block.
-
#dependent_on ⇒ Object
readonly
Returns the value of attribute dependent_on.
-
#trigger_attributes ⇒ Object
readonly
Returns the value of attribute trigger_attributes.
Instance Method Summary collapse
-
#initialize(klass_name, trigger_attributes, block) ⇒ Dependency
constructor
Constructor.
- #interested_in?(changed_attrs) ⇒ Boolean
Constructor Details
#initialize(klass_name, trigger_attributes, block) ⇒ Dependency
Constructor
464 465 466 |
# File 'lib/xapian_db/document_blueprint.rb', line 464 def initialize(klass_name, trigger_attributes, block) @dependent_on, @trigger_attributes, @block = klass_name, trigger_attributes.map(&:to_s), block end |
Instance Attribute Details
#block ⇒ Object (readonly)
Returns the value of attribute block.
458 459 460 |
# File 'lib/xapian_db/document_blueprint.rb', line 458 def block @block end |
#dependent_on ⇒ Object (readonly)
Returns the value of attribute dependent_on.
458 459 460 |
# File 'lib/xapian_db/document_blueprint.rb', line 458 def dependent_on @dependent_on end |
#trigger_attributes ⇒ Object (readonly)
Returns the value of attribute trigger_attributes.
458 459 460 |
# File 'lib/xapian_db/document_blueprint.rb', line 458 def trigger_attributes @trigger_attributes end |
Instance Method Details
#interested_in?(changed_attrs) ⇒ Boolean
468 469 470 471 |
# File 'lib/xapian_db/document_blueprint.rb', line 468 def interested_in?(changed_attrs) return true if @trigger_attributes.empty? (@trigger_attributes & changed_attrs).any? end |