Class: LineAwesomeRails::AssetFinder

Inherits:
Object
  • Object
show all
Defined in:
lib/line_awesome_rails/asset_finder.rb

Constant Summary collapse

SVG_DIRECTORY =
File.expand_path(File.join(__dir__, "../../svgs"))

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(filename) ⇒ AssetFinder

Returns a new instance of AssetFinder.



8
9
10
# File 'lib/line_awesome_rails/asset_finder.rb', line 8

def initialize(filename)
  @filename = filename
end

Class Method Details

.find_asset(filename) ⇒ Object



4
5
6
# File 'lib/line_awesome_rails/asset_finder.rb', line 4

def self.find_asset(filename)
  new(filename)
end

Instance Method Details

#pathnameObject



12
13
14
# File 'lib/line_awesome_rails/asset_finder.rb', line 12

def pathname
  Pathname.new File.join(SVG_DIRECTORY, @filename)
end