Parent

Scrubyt::ConstraintAdder

Utility class for adding constraints

Originally methods of Pattern - but since Pattern was already too heavy (and after all, adding a constraint (logically) does not belong to Pattern anyway) it was moved to this utility class. In pattern everything that begins with ensure_ is automatically dispatched here.

I will not document the functions since these are just forwarders; See the 'real' functions with their documentation in Scrubyt::Constraint.rb

Public Class Methods

ensure_absence_of_ancestor_node(ancestor_node_name, attributes=[]) click to toggle source
# File lib/scrubyt/core/scraping/constraint_adder.rb, line 23
def self.ensure_absence_of_ancestor_node(ancestor_node_name, attributes=[])
  Constraint.add_ensure_absence_of_ancestor_node(ancestor_node_name, 
                                                     prepare_attributes(attributes))
end
ensure_absence_of_attribute(attribute_hash) click to toggle source
# File lib/scrubyt/core/scraping/constraint_adder.rb, line 32
def self.ensure_absence_of_attribute(attribute_hash)
  Constraint.add_ensure_absence_of_attribute(attribute_hash)
end
ensure_presence_of_ancestor_node(ancestor_node_name, attributes=[]) click to toggle source
# File lib/scrubyt/core/scraping/constraint_adder.rb, line 18
def self.ensure_presence_of_ancestor_node(ancestor_node_name, attributes=[])
  Constraint.add_ensure_presence_of_ancestor_node(ancestor_node_name, 
                                                      prepare_attributes(attributes))
end
ensure_presence_of_attribute(attribute_hash) click to toggle source
# File lib/scrubyt/core/scraping/constraint_adder.rb, line 28
def self.ensure_presence_of_attribute(attribute_hash)
  Constraint.add_ensure_presence_of_attribute(attribute_hash)
end
ensure_presence_of_pattern(ancestor_node_name) click to toggle source
# File lib/scrubyt/core/scraping/constraint_adder.rb, line 14
def self.ensure_presence_of_pattern(ancestor_node_name)    
  Constraint.add_ensure_presence_of_pattern(ancestor_node_name)
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.