Class: RailsIcons::Icon::FilePath

Inherits:
Object
  • Object
show all
Defined in:
lib/rails_icons/icon/file_path.rb

Instance Method Summary collapse

Constructor Details

#initialize(name:, library:, variant:) ⇒ FilePath

Returns a new instance of FilePath.



4
5
6
7
8
# File 'lib/rails_icons/icon/file_path.rb', line 4

def initialize(name:, library:, variant:)
  @name = name
  @library = library
  @variant = variant
end

Instance Method Details

#callObject



10
11
12
13
14
15
16
17
18
19
# File 'lib/rails_icons/icon/file_path.rb', line 10

def call
  return animated_icons_path if @library.animated?
  return custom_library_path if @library.custom?

  icon_path = icons_path_in_app || icons_path_in_engines

  raise RailsIcons::IconNotFound if icon_path.nil?

  icon_path
end