Module: Turbine::Pipeline::Journal::Read

Included in:
Turbine::Pipeline::JournalFilter
Defined in:
lib/turbine/pipeline/journal.rb

Overview

A collection of methods providing segment classes with the means to easily access values stored in an upstream Journal.

Instance Method Summary collapse

Instance Method Details

#journal(name) ⇒ Object

Public: Retrieves the values stored in the upstream journal whose name is name.

name - The name of the upstream journal.

Raises a NoSuchJournalError if the given name does not match a journal in the pipeline.

Returns an array of values.

Raises:



114
115
116
117
118
119
120
121
122
123
124
125
126
# File 'lib/turbine/pipeline/journal.rb', line 114

def journal(name)
  upstream = source

  while upstream.kind_of?(Segment)
    if upstream.is_a?(Journal) && upstream.name == name
      return upstream
    end

    upstream = upstream.source
  end

  raise NoSuchJournalError.new(name)
end