Sha256: efe29f13533cdd609cb2f509ad1f41a3d6e1303676bec9a6aa013519d22102e0

Contents?: true

Size: 410 Bytes

Versions: 18

Compression:

Stored size: 410 Bytes

Contents

module Lookbook
  class PageTabs::Component < Lookbook::BaseComponent
    renders_many :tabs, ->(**attrs, &block) do
      @tabs ||= []
      attrs[: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

18 entries across 18 versions & 1 rubygems

Version Path
lookbook-1.0.8 app/components/lookbook/page_tabs/component.rb
lookbook-1.0.7 app/components/lookbook/page_tabs/component.rb
lookbook-1.0.6 app/components/lookbook/page_tabs/component.rb
lookbook-1.0.5 app/components/lookbook/page_tabs/component.rb
lookbook-1.0.4 app/components/lookbook/page_tabs/component.rb
lookbook-1.0.3 app/components/lookbook/page_tabs/component.rb
lookbook-1.0.2 app/components/lookbook/page_tabs/component.rb
lookbook-1.0.1 app/components/lookbook/page_tabs/component.rb
lookbook-1.0.0 app/components/lookbook/page_tabs/component.rb
lookbook-1.0.0.rc.3 app/components/lookbook/page_tabs/component.rb
lookbook-1.0.0.rc.2 app/components/lookbook/page_tabs/component.rb
lookbook-1.0.0.rc.1 app/components/lookbook/page_tabs/component.rb
lookbook-1.0.0.beta.8 app/components/lookbook/page_tabs/component.rb
lookbook-1.0.0.beta.7 app/components/lookbook/page_tabs/component.rb
lookbook-1.0.0.beta.6 app/components/lookbook/page_tabs/component.rb
lookbook-1.0.0.beta.5 app/components/lookbook/page_tabs/component.rb
lookbook-1.0.0.beta.4 app/components/lookbook/page_tabs/component.rb
lookbook-1.0.0.beta.3 app/components/lookbook/page_tabs/component.rb