Class: InlineSvg::PropshaftAssetFinder
- Inherits:
-
Object
- Object
- InlineSvg::PropshaftAssetFinder
- Defined in:
- lib/inline_svg/propshaft_asset_finder.rb
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(filename) ⇒ PropshaftAssetFinder
constructor
A new instance of PropshaftAssetFinder.
- #pathname ⇒ Object
Constructor Details
#initialize(filename) ⇒ PropshaftAssetFinder
Returns a new instance of PropshaftAssetFinder.
7 8 9 |
# File 'lib/inline_svg/propshaft_asset_finder.rb', line 7 def initialize(filename) @filename = filename end |
Class Method Details
.find_asset(filename) ⇒ Object
3 4 5 |
# File 'lib/inline_svg/propshaft_asset_finder.rb', line 3 def self.find_asset(filename) new(filename) end |
Instance Method Details
#pathname ⇒ Object
11 12 13 14 |
# File 'lib/inline_svg/propshaft_asset_finder.rb', line 11 def pathname asset_path = ::Rails.application.assets.load_path.find(@filename) asset_path.path unless asset_path.nil? end |