Sha256: 253e9bd1d7b083e9ef07d1b42226acb58ef08cb4e4d00ed65d4430c532ffbf19

Contents?: true

Size: 384 Bytes

Versions: 1

Compression:

Stored size: 384 Bytes

Contents

# frozen_string_literal: true

# require 'inline_svg'

class Alveole::IconComponent < ViewComponent::Base
  include InlineSvg::ActionView

  def initialize(name, **args)
    @name = format_name(name.to_s)
    @options = args
  end

  def format_name(name)
    base_folder = "icons/"
    name = base_folder + name
    return name if name.end_with?(".svg")

    name + ".svg"
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
alveole-1.0.0.pre.alpha.1 app/components/alveole/icon_component.rb