Sha256: d697051b280e87f5e82e37989c5cc1795dc1a49e00bcc6b199052fa33227d0d4

Contents?: true

Size: 833 Bytes

Versions: 39

Compression:

Stored size: 833 Bytes

Contents

# frozen_string_literal: true

module Playbook
  module PbStatChange
    class StatChange
      include Playbook::Props

      partial "pb_stat_change/stat_change"

      prop :change, type: Playbook::Props::Enum,
                    values: %w[neutral increase decrease],
                    default: "neutral"
      prop :value, type: Playbook::Props::Percentage

      def status
        case change
        when "increase"
          "positive"
        when "decrease"
          "negative"
        else
          "neutral"
        end
      end

      def icon
        case change
        when "increase"
          "arrow-up"
        when "decrease"
          "arrow-down"
        else
          false
        end
      end

      def classname
        generate_classname("pb_stat_change_kit", status)
      end
    end
  end
end

Version data entries

39 entries across 39 versions & 1 rubygems

Version Path
playbook_ui-4.14.0 app/pb_kits/playbook/pb_stat_change/stat_change.rb
playbook_ui-4.15.1.alpha1 app/pb_kits/playbook/pb_stat_change/stat_change.rb
playbook_ui-4.13.1 app/pb_kits/playbook/pb_stat_change/stat_change.rb
playbook_ui-4.13.0 app/pb_kits/playbook/pb_stat_change/stat_change.rb
playbook_ui-4.12.0 app/pb_kits/playbook/pb_stat_change/stat_change.rb
playbook_ui-4.11.0 app/pb_kits/playbook/pb_stat_change/stat_change.rb
playbook_ui-4.11.0.pre.alpha3 app/pb_kits/playbook/pb_stat_change/stat_change.rb
playbook_ui-4.11.0.pre.alpha.pre.2 app/pb_kits/playbook/pb_stat_change/stat_change.rb
playbook_ui-4.10.0 app/pb_kits/playbook/pb_stat_change/stat_change.rb
playbook_ui-4.10.0.pre.alpha1 app/pb_kits/playbook/pb_stat_change/stat_change.rb
playbook_ui-4.9.0.pre.alpha1 app/pb_kits/playbook/pb_stat_change/stat_change.rb
playbook_ui-4.9.0 app/pb_kits/playbook/pb_stat_change/stat_change.rb
playbook_ui-4.8.2 app/pb_kits/playbook/pb_stat_change/stat_change.rb
playbook_ui-4.8.1 app/pb_kits/playbook/pb_stat_change/stat_change.rb
playbook_ui-4.7.1 app/pb_kits/playbook/pb_stat_change/stat_change.rb
playbook_ui-4.7.0 app/pb_kits/playbook/pb_stat_change/stat_change.rb
playbook_ui-4.6.1 app/pb_kits/playbook/pb_stat_change/stat_change.rb
playbook_ui-4.6.0 app/pb_kits/playbook/pb_stat_change/stat_change.rb
playbook_ui-4.5.2 app/pb_kits/playbook/pb_stat_change/stat_change.rb
playbook_ui-4.5.1 app/pb_kits/playbook/pb_stat_change/stat_change.rb