Sha256: 480aaa1c5eec7376358e8b75c97a41b60f6732b80f3874d7b9836bb44c7f48ab
Contents?: true
Size: 505 Bytes
Versions: 11
Compression:
Stored size: 505 Bytes
Contents
# frozen_string_literal: true module Motor class IconsController < ApiBaseController CACHE_STORE = ActiveSupport::Cache::MemoryStore.new def index data = CACHE_STORE.fetch('icons') do Motor::Assets.icons.map do |icon| svg = Motor::Assets.load_asset("icons/#{icon}", gzip: !Motor.development?) svg = ActiveSupport::Gzip.decompress(svg) unless Motor.development? [icon, svg] end end render json: { data: data } end end end
Version data entries
11 entries across 11 versions & 1 rubygems