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.167'.freeze
VERSION =
'1.0.0.167'.freeze

Instance Method Summary collapse

Instance Method Details

#fluent(symbol, options = {}) ⇒ Object



9
10
11
12
13
14
15
16
17
18
19
20
21
22
# 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)

    tag = (:svg, icon.path.html_safe, icon.options).freeze # rubocop:disable Rails/OutputSafety
    fluent_helper_cache[cache_key] = tag
  end

  tag
end