Sha256: db3501cd4695ee951c14de3275e2b5147728f39ce1a2584d2c29376ddac6af79

Contents?: true

Size: 697 Bytes

Versions: 6

Compression:

Stored size: 697 Bytes

Contents

module Slacken
  # Public: Base class of filters for DocumentComponent.
  class Filter
    attr_reader :options
    def initialize(options = {})
      @options = options
    end

    # Public: Create a new refined DocumentComponent from the given component.
    #
    # component - A DocumentComponent object.
    #
    # Returns a new refined DocumentComponent object.
    def call(component)
      fail NotImplementedError
    end

    # Public: Check if the given component passes postcondition of the filter.
    #
    # component - A DocumentComponent object to check.
    #
    # Returns true if the component passes the postcondition.
    def valid?(component)
      true
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
slacken-0.1.6 lib/slacken/filter.rb
slacken-0.1.5 lib/slacken/filter.rb
slacken-0.1.4 lib/slacken/filter.rb
slacken-0.1.3 lib/slacken/filter.rb
slacken-0.1.2 lib/slacken/filter.rb
slacken-0.1.1 lib/slacken/filter.rb