Module: Masamune::Actions::DataFlow::ClassMethods

Defined in:
lib/masamune/actions/data_flow.rb

Overview

rubocop:disable Style/ClassVars

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.reset_module!Object



136
137
138
139
140
141
142
# File 'lib/masamune/actions/data_flow.rb', line 136

def reset_module!
  @@namespaces = []
  @@targets = []
  @@sources = []
  @@commands = []
  @@engine = nil
end

Instance Method Details

#create_command(*a) ⇒ Object



123
124
125
126
127
128
# File 'lib/masamune/actions/data_flow.rb', line 123

def create_command(*a)
  initialize_module!
  super.tap do
    @@commands += a
  end
end

#engineObject



130
131
132
# File 'lib/masamune/actions/data_flow.rb', line 130

def engine
  @@engine ||= Masamune::DataPlan::Builder.instance.build(@@namespaces, @@commands, @@sources, @@targets)
end

#skipObject



105
106
107
108
109
110
# File 'lib/masamune/actions/data_flow.rb', line 105

def skip
  initialize_module!
  @@namespaces << namespace
  @@sources << { skip: true }
  @@targets << { skip: true }
end

#source(source_options = {}) ⇒ Object



112
113
114
115
116
# File 'lib/masamune/actions/data_flow.rb', line 112

def source(source_options = {})
  initialize_module!
  @@namespaces << namespace
  @@sources << source_options
end

#target(target_options = {}) ⇒ Object



118
119
120
121
# File 'lib/masamune/actions/data_flow.rb', line 118

def target(target_options = {})
  initialize_module!
  @@targets << target_options
end