Class: Blender::Task::Blend
- Inherits:
-
Base
- Object
- Base
- Blender::Task::Blend
show all
- Defined in:
- lib/blender/tasks/blend.rb
Instance Attribute Summary collapse
Attributes inherited from Base
#command, #driver, #driver_opts, #hosts, #metadata, #name
Instance Method Summary
collapse
Methods inherited from Base
#add_metadata, #default_metadata, #driver_options, #ignore_failure, #members, #use_driver
Methods included from Discovery
#build_discovery, #old_search, #search, #search_with_config
#camelcase, #symbolize
Constructor Details
#initialize(name, metadata = {}) ⇒ Blend
Returns a new instance of Blend.
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
|
# File 'lib/blender/tasks/blend.rb', line 25
def initialize(name, metadata = {})
super
@command = Struct.new(
:file,
:strategy,
:pass_configs,
:config_store,
:concurrency,
:options
).new
@command.strategy = :default
@command.concurrency = 1
@command.pass_configs = []
@command.config_store = ThreadSafe::Cache.new
@command.options = ThreadSafe::Hash.new
end
|
Instance Attribute Details
#blender_strategy ⇒ Object
Returns the value of attribute blender_strategy.
23
24
25
|
# File 'lib/blender/tasks/blend.rb', line 23
def blender_strategy
@blender_strategy
end
|
Instance Method Details
#concurrency(n) ⇒ Object
52
53
54
|
# File 'lib/blender/tasks/blend.rb', line 52
def concurrency(n)
@command.concurrency = n
end
|
#config(key, opts = {}) ⇒ Object
60
61
62
|
# File 'lib/blender/tasks/blend.rb', line 60
def config(key, opts = {})
@command.config_store[key] = opts
end
|
#execute(f) ⇒ Object
Also known as:
file
46
47
48
|
# File 'lib/blender/tasks/blend.rb', line 46
def execute(f)
@command.file = f
end
|
#options(hash) ⇒ Object
64
65
66
|
# File 'lib/blender/tasks/blend.rb', line 64
def options(hash)
@command.options.merge!(hash)
end
|
#pass_configs(*keys) ⇒ Object
56
57
58
|
# File 'lib/blender/tasks/blend.rb', line 56
def pass_configs(*keys)
@command.pass_configs += keys unless keys.empty?
end
|
#strategy(st) ⇒ Object
42
43
44
|
# File 'lib/blender/tasks/blend.rb', line 42
def strategy(st)
@command.strategy = st
end
|