Sha256: d43afdf6a9d91e48e47923d717b787fce4a92d40d4c94826b785aa90c65bd5d5

Contents?: true

Size: 398 Bytes

Versions: 5

Compression:

Stored size: 398 Bytes

Contents

# frozen_string_literal: true

module Kaui
  module ApplicationHelper
    def tenant_selected?
      session[:kb_tenant_id].present?
    end

    def truncate_class_name(klass, with_abbr)
      splitted = klass.split('.')
      if with_abbr
        splitted.each_with_index.map { |k, idx| idx == splitted.size - 1 ? k : "#{k[0]}." }.join
      else
        splitted[-1]
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
kaui-3.0.5 app/helpers/kaui/application_helper.rb
kaui-3.0.4 app/helpers/kaui/application_helper.rb
kaui-3.0.2 app/helpers/kaui/application_helper.rb
kaui-2.2.1 app/helpers/kaui/application_helper.rb
kaui-3.0.1 app/helpers/kaui/application_helper.rb