class Arboretum::Scandent::ScandentRule

Attributes

paths[RW]

Public Class Methods

new(rule_paths) click to toggle source
# File lib/arboretum/scandent.rb, line 25
def initialize(rule_paths)
  @paths = rule_paths
end

Public Instance Methods

matches?(element)
Alias for: valid_on?
selects?(element)
Alias for: valid_on?
to_s() click to toggle source
# File lib/arboretum/scandent.rb, line 36
def to_s
  rule_str = ''
  @paths.each do |path|
    rule_str << ', ' unless rule_str.empty?
    rule_str << path.to_s
  end
  rule_str
end
valid_on?(element) click to toggle source
# File lib/arboretum/scandent.rb, line 29
def valid_on?(element)
  @paths.each {|path| return true if path.valid_on?(element)}
  return false
end
Also aliased as: selects?, matches?