module Datacraft::Context
define the context of the instruction
Public Instance Methods
consumers()
click to toggle source
# File lib/datacraft/context.rb, line 20 def consumers @consumers ||= [] end
options()
click to toggle source
# File lib/datacraft/context.rb, line 24 def options @options ||= {} end
post_hooks()
click to toggle source
# File lib/datacraft/context.rb, line 16 def post_hooks @post_hooks ||= [] end
pre_hooks()
click to toggle source
# File lib/datacraft/context.rb, line 12 def pre_hooks @pre_hooks ||= [] end
sources()
click to toggle source
# File lib/datacraft/context.rb, line 4 def sources @sources ||= [] end
tweakers()
click to toggle source
# File lib/datacraft/context.rb, line 8 def tweakers @tweakers ||= [] end
validate()
click to toggle source
# File lib/datacraft/context.rb, line 28 def validate fail InvalidInstruction, "Please define data source with keyword 'from'." unless sources.size > 0 fail InvalidInstruction, "Please define data consumer with keyword 'to'." unless consumers.size > 0 sources.each(&:validate) consumers.each(&:validate) tweakers.each(&:validate) pre_hooks.each(&:validate) post_hooks.each(&:validate) end