Class: Jsus::Util::PostProcessor::Base

Inherits:
Object
  • Object
show all
Includes:
Mixins::OperatesOnSources
Defined in:
lib/jsus/util/post_processor/base.rb

Overview

Base class for post-processing routines. Post-processors are non-mutating boxes that accept a collection of SourceFile-s on input and return a collection of SourceFiles on output.

Post-processing is not mutating the arguments, but dupes them instead

Direct Known Subclasses

Moocompat12, MooltIE8, Semicolon

Instance Method Summary collapse

Methods included from Mixins::OperatesOnSources

#source_files, #source_files=

Constructor Details

#initialize(pool_or_array_or_container = []) ⇒ Base

Constructor accepts pool or array or container and adds every file to its source files set.

Parameters:



16
17
18
# File 'lib/jsus/util/post_processor/base.rb', line 16

def initialize(pool_or_array_or_container = [])
  self.source_files = pool_or_array_or_container
end

Instance Method Details

#process(options = {}) ⇒ Array

This method is abstract.

Override in subclasses

Note:

This method should not mutate input sources

Processes input source files, return a resulting collection

Parameters:

  • options (Hash) (defaults to: {})

    options hash

Returns:

  • (Array)

    processed source files

Raises:

  • (NotImplementedError)


26
27
28
# File 'lib/jsus/util/post_processor/base.rb', line 26

def process(options = {})
  raise NotImplementedError, "override #process in subclasses"
end