Class: GoodData::CloverGenerator::DSL::Flow
- Inherits:
-
Object
- Object
- GoodData::CloverGenerator::DSL::Flow
- Defined in:
- lib/dsl/project_dsl.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
Returns the value of attribute name.
-
#steps ⇒ Object
Returns the value of attribute steps.
Class Method Summary collapse
Instance Method Summary collapse
- #flow_name(name) ⇒ Object
- #graph(graph, &bl) ⇒ Object
-
#initialize ⇒ Flow
constructor
A new instance of Flow.
- #metadata(name = nil, options = {}, &bl) ⇒ Object
- #parallel(&bl) ⇒ Object
- #sink(options = {}, &bl) ⇒ Object
- #step(options = {}, &bl) ⇒ Object
- #tap(options = {}, &bl) ⇒ Object
Constructor Details
#initialize ⇒ Flow
Returns a new instance of Flow.
74 75 76 |
# File 'lib/dsl/project_dsl.rb', line 74 def initialize @steps = [] end |
Instance Attribute Details
#name ⇒ Object
Returns the value of attribute name.
64 65 66 |
# File 'lib/dsl/project_dsl.rb', line 64 def name @name end |
#steps ⇒ Object
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,={}, &bl) steps.last[:metadata_block] = [] if steps.last[:metadata_block].nil? steps.last[:metadata_block] << {:name => name, :block => bl, :out_as => [: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(={}, &bl) step(:type => :upload, :id => [:id], &bl) end |
#step(options = {}, &bl) ⇒ Object
98 99 100 101 102 103 104 |
# File 'lib/dsl/project_dsl.rb', line 98 def step(={}, &bl) graph = [:graph] type = [:type] steps.push() puts "Running step #{graph}" end |
#tap(options = {}, &bl) ⇒ Object
82 83 84 |
# File 'lib/dsl/project_dsl.rb', line 82 def tap(={}, &bl) step({:type => :tap, :source_name => [:id]}) end |