Class: FoxTail::IconSets::HeroIconSet

Inherits:
Base
  • Object
show all
Defined in:
lib/fox_tail/icon_sets/hero_icon_set.rb

Constant Summary collapse

ROOT_DIR =
"app/assets/vendor/heroicons"
VARIANTS =
{solid: 24, outline: 24, mini: 20, micro: 16}.freeze
VARIANT_STYLES =
{mini: :solid, micro: :solid}.freeze

Instance Attribute Summary

Attributes inherited from Base

#name

Instance Method Summary collapse

Methods inherited from Base

#initialize

Constructor Details

This class inherits a constructor from FoxTail::IconSets::Base

Instance Method Details

#path(icon, variant: :solid) ⇒ Object



10
11
12
13
14
15
16
17
18
19
# File 'lib/fox_tail/icon_sets/hero_icon_set.rb', line 10

def path(icon, variant: :solid)
  variant = variant.to_sym
  __raise_invalid_variant(variant) unless VARIANTS.key?(variant)

  file_name = "#{normalize_icon_name(icon)}.svg"
  size = VARIANTS[variant].to_s
  style = VARIANT_STYLES.fetch(variant, variant).to_s

  root_path.join size, style, file_name
end

#root_pathObject



21
22
23
# File 'lib/fox_tail/icon_sets/hero_icon_set.rb', line 21

def root_path
  FoxTail.root.join(ROOT_DIR)
end