Sha256: 6c10cad1aaef26668df60a66ea167a0babe5a73bcac3a1e691361d7303a21e56

Contents?: true

Size: 348 Bytes

Versions: 555

Compression:

Stored size: 348 Bytes

Contents

# frozen_string_literal: true

module Playbook
  module Props
    class Percentage < Playbook::Props::Base
      def validate(value)
        value.nil? || numeric_in_range?(value)
      end

    private

      def numeric_in_range?(value)
        value.is_a?(::Numeric) &&
          value <= 100 &&
          value >= 0
      end
    end
  end
end

Version data entries

555 entries across 555 versions & 1 rubygems

Version Path
playbook_ui-13.29.0.pre.alpha.testingcollapsibleissue3052 lib/playbook/props/percentage.rb
playbook_ui-13.29.0 lib/playbook/props/percentage.rb
playbook_ui-13.28.0.pre.alpha.PBNTR297gradientoverlay3029 lib/playbook/props/percentage.rb
playbook_ui-13.28.0.pre.alpha.pbntr312tableheaderflexremoval3019 lib/playbook/props/percentage.rb
playbook_ui-13.28.0.pre.alpha.dialogturbostreameventlistener3017 lib/playbook/props/percentage.rb
playbook_ui-13.28.0.pre.alpha.PLAY1338alpha3001 lib/playbook/props/percentage.rb
playbook_ui-13.28.0.pre.alpha.PLAY1343fixTooltiprunwayissue2987 lib/playbook/props/percentage.rb
playbook_ui-13.28.0.pre.alpha.PLAY1343fixTooltiprunwayissue2986 lib/playbook/props/percentage.rb
playbook_ui-13.28.0.pre.alpha.PLAY1343fixTooltiprunwayissue2984 lib/playbook/props/percentage.rb
playbook_ui-13.27.0 lib/playbook/props/percentage.rb
playbook_ui-13.26.0.pre.alpha.PBNTR291Dropdownrailsv22840 lib/playbook/props/percentage.rb
playbook_ui-13.26.0.pre.alpha.jasoncypretpatch12820 lib/playbook/props/percentage.rb
playbook_ui-13.26.0.pre.alpha.jasoncypretpatch12816 lib/playbook/props/percentage.rb
playbook_ui-13.25.0.pre.alpha.PBNTR291Dropdownrailsv22812 lib/playbook/props/percentage.rb
playbook_ui-13.26.0 lib/playbook/props/percentage.rb
playbook_ui-13.25.0.pre.alpha.PLAY1249fixTooltipswrappingformelementscausingmisalignment2785 lib/playbook/props/percentage.rb
playbook_ui-13.25.0.pre.alpha.PLAY1249fixTooltipswrappingformelementscausingmisalignment2783 lib/playbook/props/percentage.rb
playbook_ui-13.25.0.pre.alpha.PBNTR272Dropdownkitv42769 lib/playbook/props/percentage.rb
playbook_ui-13.25.0.pre.alpha.barchartfix2766 lib/playbook/props/percentage.rb
playbook_ui-13.25.0.pre.alpha.PLAY761globalpaddingpropsbuttons2713 lib/playbook/props/percentage.rb