Class: TestAssetGenerator
- Inherits:
-
Object
- Object
- TestAssetGenerator
- Defined in:
- app/services/test_asset_generator.rb
Instance Attribute Summary collapse
-
#base_name ⇒ Object
readonly
Returns the value of attribute base_name.
-
#directory_per_level ⇒ Object
readonly
Returns the value of attribute directory_per_level.
-
#file_count_per_directory ⇒ Object
readonly
Returns the value of attribute file_count_per_directory.
-
#levels ⇒ Object
readonly
Returns the value of attribute levels.
-
#mediaflux_session ⇒ Object
readonly
Returns the value of attribute mediaflux_session.
Instance Method Summary collapse
- #generate ⇒ Object
-
#initialize(user:, project_id:, levels: 5, directory_per_level: 100, file_count_per_directory: 1000) ⇒ TestAssetGenerator
constructor
A new instance of TestAssetGenerator.
Constructor Details
#initialize(user:, project_id:, levels: 5, directory_per_level: 100, file_count_per_directory: 1000) ⇒ TestAssetGenerator
Returns a new instance of TestAssetGenerator.
4 5 6 7 8 9 10 11 12 |
# File 'app/services/test_asset_generator.rb', line 4 def initialize(user:, project_id:, levels: 5, directory_per_level: 100, file_count_per_directory: 1000) @user = user @project = Project.find(project_id) @levels = levels @directory_per_level = directory_per_level @file_count_per_directory = file_count_per_directory @base_name = @project.project_directory_short @mediaflux_session = @user.mediaflux_session end |
Instance Attribute Details
#base_name ⇒ Object (readonly)
Returns the value of attribute base_name.
3 4 5 |
# File 'app/services/test_asset_generator.rb', line 3 def base_name @base_name end |
#directory_per_level ⇒ Object (readonly)
Returns the value of attribute directory_per_level.
3 4 5 |
# File 'app/services/test_asset_generator.rb', line 3 def directory_per_level @directory_per_level end |
#file_count_per_directory ⇒ Object (readonly)
Returns the value of attribute file_count_per_directory.
3 4 5 |
# File 'app/services/test_asset_generator.rb', line 3 def file_count_per_directory @file_count_per_directory end |
#levels ⇒ Object (readonly)
Returns the value of attribute levels.
3 4 5 |
# File 'app/services/test_asset_generator.rb', line 3 def levels @levels end |
#mediaflux_session ⇒ Object (readonly)
Returns the value of attribute mediaflux_session.
3 4 5 |
# File 'app/services/test_asset_generator.rb', line 3 def mediaflux_session @mediaflux_session end |
Instance Method Details
#generate ⇒ Object
14 15 16 |
# File 'app/services/test_asset_generator.rb', line 14 def generate generate_level(@project.mediaflux_id, levels) end |