Class: Minionizer::TaskTemplate
- Inherits:
-
Object
- Object
- Minionizer::TaskTemplate
- Defined in:
- lib/core/task_template.rb
Direct Known Subclasses
FileInjection, FolderCreation, PublicSshKeyInjection, UserCreation
Instance Attribute Summary collapse
-
#options ⇒ Object
readonly
Returns the value of attribute options.
-
#session ⇒ Object
readonly
Returns the value of attribute session.
Instance Method Summary collapse
- #download_file(source, destination) ⇒ Object
-
#initialize(session, options = {}) ⇒ TaskTemplate
constructor
A new instance of TaskTemplate.
- #method_missing(method_name, *arguments, &block) ⇒ Object
- #respond_to?(method_name, include_private = false) ⇒ Boolean
Constructor Details
#initialize(session, options = {}) ⇒ TaskTemplate
Returns a new instance of TaskTemplate.
5 6 7 8 |
# File 'lib/core/task_template.rb', line 5 def initialize(session, = {}) @session = session @options = .with_indifferent_access end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method_name, *arguments, &block) ⇒ Object
10 11 12 13 14 15 16 |
# File 'lib/core/task_template.rb', line 10 def method_missing(method_name, *arguments, &block) if .key?(method_name) [method_name] else super end end |
Instance Attribute Details
#options ⇒ Object (readonly)
Returns the value of attribute options.
3 4 5 |
# File 'lib/core/task_template.rb', line 3 def @options end |
#session ⇒ Object (readonly)
Returns the value of attribute session.
3 4 5 |
# File 'lib/core/task_template.rb', line 3 def session @session end |
Instance Method Details
#download_file(source, destination) ⇒ Object
22 23 24 |
# File 'lib/core/task_template.rb', line 22 def download_file(source, destination) session.exec(%Q{bash -c "mkdir -p #{destination}; cd #{destination}; wget -nc #{source}"}) end |
#respond_to?(method_name, include_private = false) ⇒ Boolean
18 19 20 |
# File 'lib/core/task_template.rb', line 18 def respond_to?(method_name, include_private = false) .key?(method_name) || super end |