Sha256: a724001e435ec51ca82baa5d0a4647281bdc24c66d69deb77cb2b8756f3b4931

Contents?: true

Size: 944 Bytes

Versions: 5

Compression:

Stored size: 944 Bytes

Contents

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

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

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

      def to_partial_path
        "pb_list/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_list/item.rb
playbook_ui-2.7.1 app/pb_kits/playbook/pb_list/item.rb
playbook_ui-2.7.0 app/pb_kits/playbook/pb_list/item.rb
playbook_ui-2.6.0 app/pb_kits/playbook/pb_list/item.rb
playbook_ui-2.5.0 app/pb_kits/playbook/pb_list/item.rb