Class: Swgr2rb::FeatureFileGenerator
- Inherits:
-
Object
- Object
- Swgr2rb::FeatureFileGenerator
- Defined in:
- lib/scaffold_generator/feature_file_generator.rb
Overview
FeatureFileGenerator generates an example feature file that uses scaffold’s base steps to make a request to one of the endpoints described by generated endpoint object models.
Instance Method Summary collapse
- #generate_feature_file ⇒ Object
-
#initialize(params) ⇒ FeatureFileGenerator
constructor
A new instance of FeatureFileGenerator.
Constructor Details
#initialize(params) ⇒ FeatureFileGenerator
Returns a new instance of FeatureFileGenerator.
10 11 12 13 |
# File 'lib/scaffold_generator/feature_file_generator.rb', line 10 def initialize(params) @params = params @filename = generate_filename end |
Instance Method Details
#generate_feature_file ⇒ Object
15 16 17 18 19 |
# File 'lib/scaffold_generator/feature_file_generator.rb', line 15 def generate_feature_file File.open(@filename, 'w') do |file| file.write(generate_lines.join("\n\n")) end end |