Sha256: 9d204e145554852c0a9c5f1ff17e7cdc768f49e318f0b6f327a02921e287caca

Contents?: true

Size: 501 Bytes

Versions: 62

Compression:

Stored size: 501 Bytes

Contents

module Workarea
  module AssetEndpoints
    class Favicons < Base
      def result
        return unless Workarea.config.favicon_allowed_sizes.include?(params[:size])
        find_asset(params[:size])&.favicon(params[:size])
      end

      def ico
        find_asset('ico')&.favicon_ico
      end

      private

      def find_asset(type)
        Content::Asset.favicons(type).first ||
        Content::Asset.favicons.first ||
        Content::Asset.favicon_placeholder
      end
    end
  end
end

Version data entries

62 entries across 62 versions & 1 rubygems

Version Path
workarea-core-3.4.13 lib/workarea/asset_endpoints/favicons.rb
workarea-core-3.4.12 lib/workarea/asset_endpoints/favicons.rb