Class: Blacklight::Rendering::Pipeline

Inherits:
Object
  • Object
show all
Defined in:
app/presenters/blacklight/rendering/pipeline.rb

Overview

The field rendering pipeline

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(values, config, document, context, options) ⇒ Pipeline

Returns a new instance of Pipeline.



10
11
12
13
14
15
16
# File 'app/presenters/blacklight/rendering/pipeline.rb', line 10

def initialize(values, config, document, context, options)
  @values = values
  @config = config
  @document = document
  @context = context
  @options = options
end

Instance Attribute Details

#configObject (readonly)

Returns the value of attribute config.



18
19
20
# File 'app/presenters/blacklight/rendering/pipeline.rb', line 18

def config
  @config
end

#contextObject (readonly)

Returns the value of attribute context.



18
19
20
# File 'app/presenters/blacklight/rendering/pipeline.rb', line 18

def context
  @context
end

#documentObject (readonly)

Returns the value of attribute document.



18
19
20
# File 'app/presenters/blacklight/rendering/pipeline.rb', line 18

def document
  @document
end

#optionsObject (readonly)

Returns the value of attribute options.



18
19
20
# File 'app/presenters/blacklight/rendering/pipeline.rb', line 18

def options
  @options
end

#valuesObject (readonly)

Returns the value of attribute values.



18
19
20
# File 'app/presenters/blacklight/rendering/pipeline.rb', line 18

def values
  @values
end

Class Method Details

.render(values, config, document, context, options) ⇒ Object



20
21
22
# File 'app/presenters/blacklight/rendering/pipeline.rb', line 20

def self.render(values, config, document, context, options)
  new(values, config, document, context, options).render
end

Instance Method Details

#renderObject



24
25
26
27
# File 'app/presenters/blacklight/rendering/pipeline.rb', line 24

def render
  first, *rest = *stack
  first.new(values, config, document, context, options, rest).render
end

#stackObject (protected)

Ordered list of operations, Terminator must be at the end.



32
33
34
# File 'app/presenters/blacklight/rendering/pipeline.rb', line 32

def stack
  operations + [Terminator]
end