Treequel::Filter::

Component

class
Superclass
Object
Extended With
Loggability

An abstract class for filter components. Subclass and override to_s to implement a custom Component class.

Public Class Methods

anchor
inherited( klass )

Inherited hook: re-expose inheriting class's .new method

# File lib/treequel/filter.rb, line 96
def self::inherited( klass )
        klass.module_eval( 'public_class_method :new' )
        super
end

Public Instance Methods

anchor
inspect()

Return a human-readable string representation of the component suitable for debugging.

# File lib/treequel/filter.rb, line 113
def inspect
        return %Q{#<%s:0x%0x "%s">} % [
                self.class.name,
                self.object_id * 2,
                self.to_s,
        ]
end
anchor
promiscuous?()

Components are non-promiscuous (don't match everything) by default.

# File lib/treequel/filter.rb, line 122
def promiscuous?
        return false
end
anchor
to_s()

Stringify the component. :TODO: If this doesn't end up being a refactored version of all of its subclasses's to_s methods, test that it needs overriding.

# File lib/treequel/filter.rb, line 105
def to_s
        raise NotImplementedError, "%s does not provide an implementation of #to_s" %
                [ self.class.name ]
end