Class: Disloku::BaseTask
- Inherits:
-
Object
show all
- Defined in:
- lib/disloku/BaseTask.rb
Instance Attribute Summary collapse
Instance Method Summary
collapse
Constructor Details
Returns a new instance of BaseTask.
6
7
8
|
# File 'lib/disloku/BaseTask.rb', line 6
def initialize()
@result = {}
end
|
Instance Attribute Details
#changesets ⇒ Object
Returns the value of attribute changesets.
4
5
6
|
# File 'lib/disloku/BaseTask.rb', line 4
def changesets
@changesets
end
|
Instance Method Details
#afterExecute ⇒ Object
37
38
|
# File 'lib/disloku/BaseTask.rb', line 37
def afterExecute()
end
|
#beforeExecute ⇒ Object
30
31
|
# File 'lib/disloku/BaseTask.rb', line 30
def beforeExecute()
end
|
#execute ⇒ Object
21
22
23
24
25
26
27
28
|
# File 'lib/disloku/BaseTask.rb', line 21
def execute()
Log.instance.info("running task '#{self.class}'")
if (beforeExecute() != false)
executeTask()
afterExecute()
end
return @result
end
|
#executeTask ⇒ Object
33
34
35
|
# File 'lib/disloku/BaseTask.rb', line 33
def executeTask()
raise NotImplementedError.new()
end
|
10
11
12
13
14
15
16
17
18
19
|
# File 'lib/disloku/BaseTask.rb', line 10
def getInputParam(input, name, klass)
if (!input.has_key?(name))
raise ArgumentError.new("Missing input argument '#{name}' of type '#{klass}'")
end
if (!input[name].kind_of?(klass))
raise ArgumentError.new("Input argument '#{name}' is not of type '#{klass}'")
end
return input[name]
end
|