Sha256: 094b7f4222c7ede078215e17d0cd43f296b68254f309c1b3df604b9c1b1eae59

Contents?: true

Size: 802 Bytes

Versions: 4

Compression:

Stored size: 802 Bytes

Contents

# frozen_string_literal: true

module Satis
  module Tab
    class Component < Satis::ApplicationComponent
      attr_reader :options, :name, :icon, :badge, :id, :tab_menu, :selected_tab_index

      def initialize(name, *args, &block)
        super
        @name = name
        @options = args.extract_options!
        @args = args
        @icon = options[:icon]
        @id = options[:id]
        @badge = options[:badge]
        @tab_menu = options[:tab_menu]
        @block = block
        @selected_tab_index = options[:selected_tab_index]
      end

      def responsive?
        options[:responsive] == true
      end

      def selected?
        options[:selected] == true
      end

      def title
        options[:title]
      end

      def call
        content
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
satis-1.0.74 app/components/satis/tab/component.rb
satis-1.0.70 app/components/satis/tab/component.rb
satis-1.0.69 app/components/satis/tab/component.rb
satis-1.0.68 app/components/satis/tab/component.rb