Sha256: e916807483e4f39dfa9ccc1d7f82aac27bc085f3800a6dbe3b508963077b8162

Contents?: true

Size: 1.49 KB

Versions: 5

Compression:

Stored size: 1.49 KB

Contents

module Playbook
  module PbVerticalNav
    class Item < Playbook::PbKit::Base
      PROPS = [:configured_active,
          :configured_classname,
          :configured_data,
          :configured_id,
          :configured_link,
          :configured_text].freeze

      def initialize(active: default_configuration,
                   classname: default_configuration,
                   data: default_configuration,
                   id: default_configuration,
                   link: default_configuration,
                   text: default_configuration)
        self.configured_active = active
        self.configured_classname = classname
        self.configured_data = data
        self.configured_id = id
        self.configured_link = link
        self.configured_text = text
      end

      def active
        if configured_active == default_configuration
          ""
        else
          if (configured_active == true)
            "_active"
          end
        end
      end

      def link
        if configured_link == default_configuration
          "#"
        else
          configured_link
        end
      end

      def text
        if configured_text == default_configuration
          ""
        else
          configured_text
        end
      end

      def to_partial_path
        "pb_vertical_nav/item"
      end

    private

      DEFAULT = Object.new
      private_constant :DEFAULT
      def default_configuration
        DEFAULT
      end
      attr_accessor(*PROPS)
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
playbook_ui-2.7.2 app/pb_kits/playbook/pb_vertical_nav/item.rb
playbook_ui-2.7.1 app/pb_kits/playbook/pb_vertical_nav/item.rb
playbook_ui-2.7.0 app/pb_kits/playbook/pb_vertical_nav/item.rb
playbook_ui-2.6.0 app/pb_kits/playbook/pb_vertical_nav/item.rb
playbook_ui-2.5.0 app/pb_kits/playbook/pb_vertical_nav/item.rb