Class: TestProjectGenerator
- Inherits:
-
Object
- Object
- TestProjectGenerator
- Defined in:
- app/services/test_project_generator.rb
Instance Attribute Summary collapse
-
#number ⇒ Object
readonly
Returns the value of attribute number.
-
#project_prefix ⇒ Object
readonly
Returns the value of attribute project_prefix.
-
#sequence ⇒ Object
readonly
Returns the value of attribute sequence.
-
#user ⇒ Object
readonly
Returns the value of attribute user.
Instance Method Summary collapse
- #generate ⇒ Object
-
#initialize(user:, number:, project_prefix:) ⇒ TestProjectGenerator
constructor
A new instance of TestProjectGenerator.
Constructor Details
#initialize(user:, number:, project_prefix:) ⇒ TestProjectGenerator
Returns a new instance of TestProjectGenerator.
5 6 7 8 9 10 |
# File 'app/services/test_project_generator.rb', line 5 def initialize(user:, number:, project_prefix:) @user = user @number = number @sequence = number.to_s.rjust(5, "0") @project_prefix = project_prefix end |
Instance Attribute Details
#number ⇒ Object (readonly)
Returns the value of attribute number.
3 4 5 |
# File 'app/services/test_project_generator.rb', line 3 def number @number end |
#project_prefix ⇒ Object (readonly)
Returns the value of attribute project_prefix.
3 4 5 |
# File 'app/services/test_project_generator.rb', line 3 def project_prefix @project_prefix end |
#sequence ⇒ Object (readonly)
Returns the value of attribute sequence.
3 4 5 |
# File 'app/services/test_project_generator.rb', line 3 def sequence @sequence end |
#user ⇒ Object (readonly)
Returns the value of attribute user.
3 4 5 |
# File 'app/services/test_project_generator.rb', line 3 def user @user end |
Instance Method Details
#generate ⇒ Object
12 13 14 15 16 17 |
# File 'app/services/test_project_generator.rb', line 12 def generate project = create_project project.save_in_mediaflux(user: user) project.save! project end |