Sha256: 9918c91765041088af6d5b3c09324e0a0098a3e814c481e24e58ec28dd5370ed

Contents?: true

Size: 602 Bytes

Versions: 28

Compression:

Stored size: 602 Bytes

Contents

module Lookbook
  class DebugMenu::Component < Lookbook::BaseComponent
    attr_reader :features

    def initialize(version: nil, docs_url: nil, repo_url: nil, features: {}, **html_attrs)
      @version = version
      @docs_url = docs_url
      @repo_url = repo_url
      @features = features
      super(**html_attrs)
    end

    def auto_refresh_enabled?
      feature(:auto_refresh, false)
    end

    def feature(name, fallback = nil)
      features.fetch(name.to_sym, fallback)
    end

    def debug_data
      content
    end

    def debug_data?
      debug_data.present?
    end
  end
end

Version data entries

28 entries across 28 versions & 1 rubygems

Version Path
lookbook-2.3.4 app/components/lookbook/debug_menu/component.rb
lookbook-2.3.3 app/components/lookbook/debug_menu/component.rb
lookbook-2.3.2 app/components/lookbook/debug_menu/component.rb
lookbook-2.3.0 app/components/lookbook/debug_menu/component.rb
lookbook-2.2.2 app/components/lookbook/debug_menu/component.rb
lookbook-2.2.1 app/components/lookbook/debug_menu/component.rb
lookbook-2.2.0 app/components/lookbook/debug_menu/component.rb
lookbook-2.1.1 app/components/lookbook/debug_menu/component.rb
lookbook-2.1.0 app/components/lookbook/debug_menu/component.rb
lookbook-2.0.5 app/components/lookbook/debug_menu/component.rb
lookbook-2.0.4 app/components/lookbook/debug_menu/component.rb
lookbook-2.0.3 app/components/lookbook/debug_menu/component.rb
lookbook-2.0.2 app/components/lookbook/debug_menu/component.rb
lookbook-2.0.1 app/components/lookbook/debug_menu/component.rb
lookbook-2.0.0 app/components/lookbook/debug_menu/component.rb
lookbook-2.0.0.rc.3 app/components/lookbook/debug_menu/component.rb
lookbook-2.0.0.rc.2 app/components/lookbook/debug_menu/component.rb
lookbook-2.0.0.rc.1 app/components/lookbook/debug_menu/component.rb
lookbook-2.0.0.beta.9 app/components/lookbook/debug_menu/component.rb
lookbook-2.0.0.beta.8 app/components/lookbook/debug_menu/component.rb