Class: GoodData::CloverGenerator::DSL::Flow

Inherits:
Object
  • Object
show all
Defined in:
lib/dsl/project_dsl.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeFlow

Returns a new instance of Flow.



74
75
76
# File 'lib/dsl/project_dsl.rb', line 74

def initialize
  @steps = []
end

Instance Attribute Details

#nameObject

Returns the value of attribute name.



64
65
66
# File 'lib/dsl/project_dsl.rb', line 64

def name
  @name
end

#stepsObject

Returns the value of attribute steps.



64
65
66
# File 'lib/dsl/project_dsl.rb', line 64

def steps
  @steps
end

Class Method Details

.define(name = "", &script) ⇒ Object



66
67
68
69
70
71
72
# File 'lib/dsl/project_dsl.rb', line 66

def self.define(name="", &script)
  puts "Reading flow #{name}"
  x = self.new
  x.flow_name(name)
  x.instance_eval(&script)
  x
end

Instance Method Details

#flow_name(name) ⇒ Object



78
79
80
# File 'lib/dsl/project_dsl.rb', line 78

def flow_name(name)
  @name = name
end

#graph(graph, &bl) ⇒ Object



90
91
92
# File 'lib/dsl/project_dsl.rb', line 90

def graph(graph, &bl)
  step(:graph => graph, :type => :user_provided, &bl)
end

#metadata(name = nil, options = {}, &bl) ⇒ Object



106
107
108
109
# File 'lib/dsl/project_dsl.rb', line 106

def (name=nil,options={}, &bl)
  steps.last[:metadata_block] = [] if steps.last[:metadata_block].nil?
  steps.last[:metadata_block] << {:name => name, :block => bl, :out_as => options[:out_as]}
end

#parallel(&bl) ⇒ Object



94
95
96
# File 'lib/dsl/project_dsl.rb', line 94

def parallel(&bl)
  
end

#sink(options = {}, &bl) ⇒ Object



86
87
88
# File 'lib/dsl/project_dsl.rb', line 86

def sink(options={}, &bl)
  step(:type => :upload, :id => options[:id], &bl)
end

#step(options = {}, &bl) ⇒ Object



98
99
100
101
102
103
104
# File 'lib/dsl/project_dsl.rb', line 98

def step(options={}, &bl)
  graph = options[:graph]
  type = options[:type]

  steps.push(options)
  puts "Running step #{graph}"
end

#tap(options = {}, &bl) ⇒ Object



82
83
84
# File 'lib/dsl/project_dsl.rb', line 82

def tap(options={}, &bl)
  step({:type => :tap, :source_name => options[:id]})
end