Sha256: 64eadc8eefbe92bad7246da663e4dfa3e0b06f17a25997f0aaca9d75e8b15e8b
Contents?: true
Size: 674 Bytes
Versions: 28
Compression:
Stored size: 674 Bytes
Contents
# frozen_string_literal: true module ActiveElement module Components # One navigation tab in a Tabs component. class Tab attr_reader :title, :path, :content def initialize(controller, title:, path:, &block) @controller = controller @title = title @path = path @content = block_given? ? block.call : '' end def selected? controller.request.fullpath == path end def identifier Util::I18n.class_name(title) end def to_s '' end def tab(title) yield Tab.new(title) end private attr_reader :controller end end end
Version data entries
28 entries across 28 versions & 1 rubygems