Class: MediafluxScriptFactory
- Inherits:
-
Object
- Object
- MediafluxScriptFactory
- Defined in:
- app/services/mediaflux_script_factory.rb
Instance Method Summary collapse
- #aterm_script ⇒ Object
-
#initialize(project:) ⇒ MediafluxScriptFactory
constructor
A new instance of MediafluxScriptFactory.
- #project_namespace ⇒ Object
- #project_parent_path ⇒ Object
- #project_path ⇒ Object
Constructor Details
#initialize(project:) ⇒ MediafluxScriptFactory
Returns a new instance of MediafluxScriptFactory.
4 5 6 7 8 9 10 11 |
# File 'app/services/mediaflux_script_factory.rb', line 4 def initialize(project:) @project = project @metadata = project. root_ns = Rails.configuration.mediaflux["api_root_collection_namespace"] parent_collection = Rails.configuration.mediaflux["api_root_collection_name"] @root_info = Mediaflux::RootCollectionAsset.new(session_token: nil, root_ns: root_ns, parent_collection: parent_collection) end |
Instance Method Details
#aterm_script ⇒ Object
13 14 15 16 |
# File 'app/services/mediaflux_script_factory.rb', line 13 def aterm_script prolog = "# Run these steps from Aterm to create a project in Mediaflux with its related components" [prolog, script_root_tree_create, script_asset_create, script_accumulators].join("\r\n\r\n") end |
#project_namespace ⇒ Object
18 19 20 |
# File 'app/services/mediaflux_script_factory.rb', line 18 def project_namespace Pathname.new(@root_info.parent_ns).join(@project.project_directory_short + "NS") end |
#project_parent_path ⇒ Object
22 23 24 |
# File 'app/services/mediaflux_script_factory.rb', line 22 def project_parent_path Pathname.new(@root_info.path) end |
#project_path ⇒ Object
26 27 28 |
# File 'app/services/mediaflux_script_factory.rb', line 26 def project_path Pathname.new(project_parent_path).join(@project.project_directory_short) end |