Sha256: 0a6cab38b1e68bdfda34a1c7c14db658217bd1a43f7f7521619c1c460a4c4b62

Contents?: true

Size: 414 Bytes

Versions: 48

Compression:

Stored size: 414 Bytes

Contents

module Lookbook
  class PageTabs::Component < Lookbook::BaseComponent
    renders_many :tabs, ->(**attrs, &block) do
      @tabs ||= []
      attrs[:tab_content] = capture(&block)
      attrs[:markdown] ||= @markdown
      @tabs << attrs
    end

    def initialize(markdown: true, **html_attrs)
      @markdown = markdown
      super(**html_attrs)
    end

    def before_render
      tabs.size
    end
  end
end

Version data entries

48 entries across 48 versions & 1 rubygems

Version Path
lookbook-2.0.0.beta.9 app/components/lookbook/page_tabs/component.rb
lookbook-2.0.0.beta.8 app/components/lookbook/page_tabs/component.rb
lookbook-2.0.0.beta.7 app/components/lookbook/page_tabs/component.rb
lookbook-2.0.0.beta.6 app/components/lookbook/page_tabs/component.rb
lookbook-2.0.0.beta.5 app/components/lookbook/page_tabs/component.rb
lookbook-2.0.0.beta.4 app/components/lookbook/page_tabs/component.rb
lookbook-2.0.0.beta.3 app/components/lookbook/page_tabs/component.rb
lookbook-2.0.0.beta.2 app/components/lookbook/page_tabs/component.rb
lookbook-1.5.3 app/components/lookbook/page_tabs/component.rb
lookbook-2.0.0.beta.1 app/components/lookbook/page_tabs/component.rb
lookbook-1.5.2 app/components/lookbook/page_tabs/component.rb
lookbook-2.0.0.beta.0 app/components/lookbook/page_tabs/component.rb
lookbook-1.5.1 app/components/lookbook/page_tabs/component.rb
lookbook-1.5.0 app/components/lookbook/page_tabs/component.rb
lookbook-1.4.5 app/components/lookbook/page_tabs/component.rb
lookbook-1.4.4 app/components/lookbook/page_tabs/component.rb
lookbook-1.4.3 app/components/lookbook/page_tabs/component.rb
lookbook-1.4.2 app/components/lookbook/page_tabs/component.rb
lookbook-1.4.1 app/components/lookbook/page_tabs/component.rb
lookbook-1.4.0 app/components/lookbook/page_tabs/component.rb