Class: Workarea::FindPipelineAsset

Inherits:
Object
  • Object
show all
Defined in:
app/queries/workarea/find_pipeline_asset.rb

Instance Method Summary collapse

Constructor Details

#initialize(name, path: nil) ⇒ FindPipelineAsset

Returns a new instance of FindPipelineAsset.



3
4
5
6
# File 'app/queries/workarea/find_pipeline_asset.rb', line 3

def initialize(name, path: nil)
  @name = name
  @path = path || %w(app assets images workarea core)
end

Instance Method Details

#pathObject



8
9
10
11
12
13
14
# File 'app/queries/workarea/find_pipeline_asset.rb', line 8

def path
  host_app_path = Rails.root.join(*@path, @name)
  return host_app_path if host_app_path.exist?
  return plugin_path unless plugin_path.nil?

  Core::Engine.root.join(*@path, @name)
end