Class: Stackup::RakeTasks::DataOptionHash
- Inherits:
-
DataOption
- Object
- DataOption
- Stackup::RakeTasks::DataOptionHash
- Defined in:
- lib/stackup/rake_tasks.rb
Overview
An option with a Hash argument Hash content is stored in a temporary file upon conversion
Instance Attribute Summary
Attributes inherited from DataOption
Instance Method Summary collapse
Methods inherited from DataOption
Constructor Details
This class inherits a constructor from Stackup::RakeTasks::DataOption
Instance Method Details
#as_tempfile(filename, data) ⇒ Object
116 117 118 119 120 121 |
# File 'lib/stackup/rake_tasks.rb', line 116 def as_tempfile(filename, data) tempfile = Tempfile.new([filename, ".yml"]) tempfile.write(YAML.dump(data)) tempfile.close tempfile.path.to_s end |
#to_a ⇒ Object
123 124 125 |
# File 'lib/stackup/rake_tasks.rb', line 123 def to_a [@flag, as_tempfile(@flag[2..-1], @argument)] end |