Class: InlineSvg::StaticAssetFinder
- Inherits:
-
Object
- Object
- InlineSvg::StaticAssetFinder
- Defined in:
- lib/inline_svg/static_asset_finder.rb
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(filename) ⇒ StaticAssetFinder
constructor
A new instance of StaticAssetFinder.
- #pathname ⇒ Object
Constructor Details
#initialize(filename) ⇒ StaticAssetFinder
Returns a new instance of StaticAssetFinder.
11 12 13 |
# File 'lib/inline_svg/static_asset_finder.rb', line 11 def initialize(filename) @filename = filename end |
Class Method Details
.find_asset(filename) ⇒ Object
7 8 9 |
# File 'lib/inline_svg/static_asset_finder.rb', line 7 def self.find_asset(filename) new(filename) end |
Instance Method Details
#pathname ⇒ Object
15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/inline_svg/static_asset_finder.rb', line 15 def pathname if ::Rails.application.config.assets.compile ::Rails.application.assets[@filename].pathname else manifest = ::Rails.application.assets_manifest asset_path = manifest.assets[@filename] unless asset_path.nil? ::Rails.root.join(manifest.directory, asset_path) end end end |