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
|
# File 'lib/baleen/task/base.rb', line 6
def initialize
@params = {}
@params[:klass] = self.class.to_s
@params[:work_dir] = nil
@params[:files] = nil
@params[:bin] = nil
@params[:options] = 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
30
31
32
|
# File 'lib/baleen/task/base.rb', line 30
def command
@params[:command] ||= %{#{@params[:bin]} #{@params[:options]} #{@params[:files]}}
end
|
#command=(c) ⇒ Object
34
35
36
|
# File 'lib/baleen/task/base.rb', line 34
def command=(c)
@params[:command] = c
end
|
#commands ⇒ Object
22
23
24
25
26
27
28
|
# File 'lib/baleen/task/base.rb', line 22
def commands
%{
#{@params[:before_command]}
cd #{@params[:work_dir]}
#{command}
}
end
|
#respond ⇒ Object
42
43
44
|
# File 'lib/baleen/task/base.rb', line 42
def respond
nil
end
|
#result ⇒ Object
38
39
40
|
# File 'lib/baleen/task/base.rb', line 38
def result
@params[:results]
end
|
#terminate? ⇒ Boolean
46
47
48
|
# File 'lib/baleen/task/base.rb', line 46
def terminate?
true
end
|