Module: InternalHelpers

Included in:
ATD::Compilation, ATD::Route
Defined in:
lib/atd/internal_helpers.rb

Instance Method Summary collapse

Instance Method Details

#asset(name) ⇒ Object



2
3
4
5
6
7
8
# File 'lib/atd/internal_helpers.rb', line 2

def asset(name)
  return "" if name.to_s.empty?
  target_location = caller_locations.reject do |caller_location|
    File.dirname(caller_location.absolute_path.to_s).include? File.expand_path("..", __dir__)
  end
  "#{File.dirname(target_location[0].absolute_path)}/assets/#{name}"
end