Class: Baleen::Task::Base
- Inherits:
-
Object
- Object
- Baleen::Task::Base
show all
- Includes:
- Serializable
- Defined in:
- lib/baleen/task/base.rb
Instance Method Summary
collapse
deserialize, #dup, #method_missing, #params, symbolize_keys, #to_json
Constructor Details
#initialize ⇒ Base
Returns a new instance of Base.
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
# File 'lib/baleen/task/base.rb', line 6
def initialize
@params = {}
@params[:klass] = self.class.to_s
@params[:shell] = nil
@params[:opt] = nil
@params[:work_dir] = nil
@params[:files] = nil
@params[:exe] = nil
@params[:concurrency] = nil
@params[:image] = nil
@params[:before_command] = nil
@params[:command] = nil
@params[:results] = nil
@params[:status] = nil
@params[:commit] = nil
end
|
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
in the class Baleen::Serializable
Instance Method Details
#command ⇒ Object
31
32
33
|
# File 'lib/baleen/task/base.rb', line 31
def command
@params[:command] ||= %{#{@params[:exe]} #{@params[:files]}}
end
|
#command=(c) ⇒ Object
35
36
37
|
# File 'lib/baleen/task/base.rb', line 35
def command=(c)
@params[:command] = c
end
|
#commands ⇒ Object
23
24
25
26
27
28
29
|
# File 'lib/baleen/task/base.rb', line 23
def commands
%{
#{@params[:before_command]}
cd #{@params[:work_dir]}
#{command}
}
end
|
#respond ⇒ Object
43
44
45
|
# File 'lib/baleen/task/base.rb', line 43
def respond
nil
end
|
#result ⇒ Object
39
40
41
|
# File 'lib/baleen/task/base.rb', line 39
def result
@params[:results]
end
|
#terminate? ⇒ Boolean
47
48
49
|
# File 'lib/baleen/task/base.rb', line 47
def terminate?
true
end
|