Sha256: c301a2753ceb885d056d5ad5f8664554fcba6f28d3bc4f38bb73b740f65b3c4b

Contents?: true

Size: 668 Bytes

Versions: 196

Compression:

Stored size: 668 Bytes

Contents

# frozen_string_literal: true

module Playbook
  module PbMultipleUsersStacked
    class MultipleUsersStacked
      include Playbook::Props

      partial "pb_multiple_users_stacked/multiple_users_stacked"

      prop :users, type: Playbook::Props::HashArray, required: true

      def more_than_two
        users.count > 2
      end

      def only_one
        users.count == 1
      end

      def display_count
        more_than_two ? 1 : users.count
      end

      def classname
        generate_classname("pb_multiple_users_stacked_kit", single_class)
      end

    private

      def single_class
        only_one ? "single" : nil
      end
    end
  end
end

Version data entries

196 entries across 196 versions & 1 rubygems

Version Path
playbook_ui-7.14.0.pre.alpha1 app/pb_kits/playbook/pb_multiple_users_stacked/multiple_users_stacked.rb
playbook_ui-7.16.0 app/pb_kits/playbook/pb_multiple_users_stacked/multiple_users_stacked.rb
playbook_ui-7.15.1 app/pb_kits/playbook/pb_multiple_users_stacked/multiple_users_stacked.rb
playbook_ui-7.15.0 app/pb_kits/playbook/pb_multiple_users_stacked/multiple_users_stacked.rb
playbook_ui-7.14.0 app/pb_kits/playbook/pb_multiple_users_stacked/multiple_users_stacked.rb
playbook_ui-7.13.0.pre.alpha1 app/pb_kits/playbook/pb_multiple_users_stacked/multiple_users_stacked.rb
playbook_ui-7.13.0 app/pb_kits/playbook/pb_multiple_users_stacked/multiple_users_stacked.rb
playbook_ui-7.12.1 app/pb_kits/playbook/pb_multiple_users_stacked/multiple_users_stacked.rb
playbook_ui-7.12.0 app/pb_kits/playbook/pb_multiple_users_stacked/multiple_users_stacked.rb
playbook_ui-7.11.1 app/pb_kits/playbook/pb_multiple_users_stacked/multiple_users_stacked.rb
playbook_ui-7.11.0 app/pb_kits/playbook/pb_multiple_users_stacked/multiple_users_stacked.rb
playbook_ui-7.11.0.pre.alpha1 app/pb_kits/playbook/pb_multiple_users_stacked/multiple_users_stacked.rb
playbook_ui-7.10.0 app/pb_kits/playbook/pb_multiple_users_stacked/multiple_users_stacked.rb
playbook_ui-7.9.0 app/pb_kits/playbook/pb_multiple_users_stacked/multiple_users_stacked.rb
playbook_ui-7.8.4 app/pb_kits/playbook/pb_multiple_users_stacked/multiple_users_stacked.rb
playbook_ui-7.8.3 app/pb_kits/playbook/pb_multiple_users_stacked/multiple_users_stacked.rb
playbook_ui-7.8.2 app/pb_kits/playbook/pb_multiple_users_stacked/multiple_users_stacked.rb
playbook_ui-7.8.1 app/pb_kits/playbook/pb_multiple_users_stacked/multiple_users_stacked.rb
playbook_ui-7.8.0 app/pb_kits/playbook/pb_multiple_users_stacked/multiple_users_stacked.rb
playbook_ui-7.7.0.pre.alpha1 app/pb_kits/playbook/pb_multiple_users_stacked/multiple_users_stacked.rb