Module: FluentIcons

Includes:
ActionView::Helpers::TagHelper
Defined in:
lib/fluent-icons.rb,
lib/fluent-icons/fluent.rb,
lib/fluent-icons/helper.rb,
lib/fluent-icons/railtie.rb,
lib/fluent-icons/version.rb

Defined Under Namespace

Classes: Fluent, Railtie

Constant Summary collapse

SYMBOLS =
JSON.parse(data).freeze
FLUENT_UI_ICONS_VERSION =
'1.1.186'.freeze
VERSION =
'1.0.2.186'.freeze

Instance Method Summary collapse

Instance Method Details

#fluent(symbol, options = {}) ⇒ Object Also known as: fluent_icon



9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/fluent-icons/helper.rb', line 9

def fluent(symbol, options = {})
  return '' if symbol.nil?

  cache_key = [symbol, options]

  unless (tag = fluent_helper_cache[cache_key])
    icon = FluentIcons::Fluent.new(symbol, options)
    fluent_helper_cache[cache_key] = icon.to_svg
  end

  tag&.html_safe
end