Class: Awestruct::Pipeline

Inherits:
Object
  • Object
show all
Defined in:
lib/awestruct/pipeline.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializePipeline

Returns a new instance of Pipeline.



11
12
13
14
15
16
# File 'lib/awestruct/pipeline.rb', line 11

def initialize()
  @handler_chains = HandlerChains.new
  @extensions     = []
  @helpers        = []
  @transformers   = []
end

Instance Attribute Details

#handler_chainsObject (readonly)

Returns the value of attribute handler_chains.



9
10
11
# File 'lib/awestruct/pipeline.rb', line 9

def handler_chains
  @handler_chains
end

Instance Method Details

#execute(site) ⇒ Object



30
31
32
# File 'lib/awestruct/pipeline.rb', line 30

def execute(site)
  execute_extensions(site)
end

#execute_extensions(site) ⇒ Object



34
35
36
37
38
# File 'lib/awestruct/pipeline.rb', line 34

def execute_extensions(site)
  @extensions.each do |e|
    e.execute(site)
  end
end

#extension(e) ⇒ Object



18
19
20
# File 'lib/awestruct/pipeline.rb', line 18

def extension(e)
  @extensions << e
end

#helper(h) ⇒ Object



22
23
24
# File 'lib/awestruct/pipeline.rb', line 22

def helper(h)
  @helpers << h
end

#mixin_helpers(context) ⇒ Object



40
41
42
43
44
45
# File 'lib/awestruct/pipeline.rb', line 40

def mixin_helpers(context)
  context.extend( Awestruct::ContextHelper )
  @helpers.each do |h|
    context.extend(h)
  end
end

#transformer(t) ⇒ Object



26
27
28
# File 'lib/awestruct/pipeline.rb', line 26

def transformer(t)
  @transformers << t
end