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.0.1.pre.alpha9 app/pb_kits/playbook/pb_multiple_users_stacked/multiple_users_stacked.rb
playbook_ui-6.5.1 app/pb_kits/playbook/pb_multiple_users_stacked/multiple_users_stacked.rb
playbook_ui-6.5.0 app/pb_kits/playbook/pb_multiple_users_stacked/multiple_users_stacked.rb
playbook_ui-7.0.1.pre.alpha8 app/pb_kits/playbook/pb_multiple_users_stacked/multiple_users_stacked.rb
playbook_ui-7.0.1.pre.alpha7 app/pb_kits/playbook/pb_multiple_users_stacked/multiple_users_stacked.rb
playbook_ui-7.0.1.pre.alpha6 app/pb_kits/playbook/pb_multiple_users_stacked/multiple_users_stacked.rb
playbook_ui-7.0.1.pre.alpha5 app/pb_kits/playbook/pb_multiple_users_stacked/multiple_users_stacked.rb
playbook_ui-7.0.1.pre.alpha4 app/pb_kits/playbook/pb_multiple_users_stacked/multiple_users_stacked.rb
playbook_ui-7.0.1.pre.alpha3 app/pb_kits/playbook/pb_multiple_users_stacked/multiple_users_stacked.rb
playbook_ui-7.0.1.pre.alpha2 app/pb_kits/playbook/pb_multiple_users_stacked/multiple_users_stacked.rb
playbook_ui-6.4.2 app/pb_kits/playbook/pb_multiple_users_stacked/multiple_users_stacked.rb
playbook_ui-7.0.1.pre.alpha1 app/pb_kits/playbook/pb_multiple_users_stacked/multiple_users_stacked.rb
playbook_ui-7.0.0.pre.alpha9 app/pb_kits/playbook/pb_multiple_users_stacked/multiple_users_stacked.rb
playbook_ui-7.0.0.pre.alpha8 app/pb_kits/playbook/pb_multiple_users_stacked/multiple_users_stacked.rb
playbook_ui-7.0.0.pre.alpha7 app/pb_kits/playbook/pb_multiple_users_stacked/multiple_users_stacked.rb
playbook_ui-6.4.1 app/pb_kits/playbook/pb_multiple_users_stacked/multiple_users_stacked.rb
playbook_ui-7.0.0.pre.alpha6 app/pb_kits/playbook/pb_multiple_users_stacked/multiple_users_stacked.rb
playbook_ui-7.0.0.pre.alpha5 app/pb_kits/playbook/pb_multiple_users_stacked/multiple_users_stacked.rb
playbook_ui-6.4.0 app/pb_kits/playbook/pb_multiple_users_stacked/multiple_users_stacked.rb
playbook_ui-6.3.1 app/pb_kits/playbook/pb_multiple_users_stacked/multiple_users_stacked.rb