Sha256: e9d77ec45a4ed8b7d683c12dcdb8b4fbb35b693b6b22ad723dfa9dd7b880019b

Contents?: true

Size: 350 Bytes

Versions: 842

Compression:

Stored size: 350 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

842 entries across 842 versions & 1 rubygems

Version Path
playbook_ui-13.19.0.pre.alpha.play1186collapsiblenaviconcolorbug2321 lib/playbook/props/percentage.rb
playbook_ui-13.19.0.pre.alpha.PBNTR211tablekitsubcomponentsreact2318 lib/playbook/props/percentage.rb
playbook_ui-13.19.0.pre.alpha.play1174fixconfimationtoastmobilebug2306 lib/playbook/props/percentage.rb
playbook_ui-13.19.0.pre.alpha.play1174fixconfimationtoastmobilebug2305 lib/playbook/props/percentage.rb
playbook_ui-13.20.0 lib/playbook/props/percentage.rb
playbook_ui-13.19.0.pre.alpha.play1141iconkitusinglibrary2264 lib/playbook/props/percentage.rb
playbook_ui-13.19.0.pre.alpha.PBNTR207tabledivsupport2261 lib/playbook/props/percentage.rb
playbook_ui-13.19.0.pre.alpha.PBNTR207tabledivsupport2245 lib/playbook/props/percentage.rb
playbook_ui-13.19.0 lib/playbook/props/percentage.rb
playbook_ui-13.18.0.pre.alpha.thor93bargraphoptions2219 lib/playbook/props/percentage.rb
playbook_ui-13.18.0.pre.alpha.thor93bargraphoptions2211 lib/playbook/props/percentage.rb
playbook_ui-13.18.0.pre.alpha.play1141iconkitusinglibrary2210 lib/playbook/props/percentage.rb
playbook_ui-13.18.0.pre.alpha.PLAY12062203 lib/playbook/props/percentage.rb
playbook_ui-13.18.0.pre.alpha.powercentrainplaybookpt22201 lib/playbook/props/percentage.rb
playbook_ui-13.18.0.pre.alpha.PLAY8672199 lib/playbook/props/percentage.rb
playbook_ui-13.18.0.pre.alpha.PBNTR191AdvancedTableFinalFixes2197 lib/playbook/props/percentage.rb
playbook_ui-13.18.0.pre.alpha.dependabotnpmandyarnreactrouterdom62212196 lib/playbook/props/percentage.rb
playbook_ui-13.18.0.pre.alpha.dependabotnpmandyarntypescripteslintparser56202194 lib/playbook/props/percentage.rb
playbook_ui-13.18.0.pre.alpha.PLAY12062192 lib/playbook/props/percentage.rb
playbook_ui-13.18.0.pre.alpha.useexactnodejsversionghactions2183 lib/playbook/props/percentage.rb