Class: TestAssetGenerator

Inherits:
Object
  • Object
show all
Defined in:
app/services/test_asset_generator.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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_nameObject (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_levelObject (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_directoryObject (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

#levelsObject (readonly)

Returns the value of attribute levels.



3
4
5
# File 'app/services/test_asset_generator.rb', line 3

def levels
  @levels
end

#mediaflux_sessionObject (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

#generateObject



14
15
16
# File 'app/services/test_asset_generator.rb', line 14

def generate
  generate_level(@project.mediaflux_id, levels)
end