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-14.0.0.pre.alpha.PLAY15063511 lib/playbook/props/percentage.rb
playbook_ui-14.0.0.pre.alpha.PA1477timestampkit3509 lib/playbook/props/percentage.rb
playbook_ui-14.0.0.pre.alpha.PLAY14733507 lib/playbook/props/percentage.rb
playbook_ui-14.0.0.pre.alpha.PBNTR416formpillsizes3506 lib/playbook/props/percentage.rb
playbook_ui-14.0.0.pre.alpha.PA1477timestampkit3502 lib/playbook/props/percentage.rb
playbook_ui-14.0.0.pre.alpha.PBNTR415starratingform3493 lib/playbook/props/percentage.rb
playbook_ui-14.0.0.pre.alpha.PBNTR415starratingform3492 lib/playbook/props/percentage.rb
playbook_ui-14.0.0.pre.alpha.PLAY1475bumpaxecoredependency3483 lib/playbook/props/percentage.rb
playbook_ui-14.0.0.pre.alpha.PLAY14733479 lib/playbook/props/percentage.rb
playbook_ui-14.0.0.pre.alpha.dependabotnpmandyarnreactjoyride2823478 lib/playbook/props/percentage.rb
playbook_ui-14.0.0.pre.alpha.PLAY14113475 lib/playbook/props/percentage.rb
playbook_ui-14.0.0.pre.alpha.play1447alphatest3462 lib/playbook/props/percentage.rb
playbook_ui-14.1.0 lib/playbook/props/percentage.rb
playbook_ui-13.34.1.pre.alpha.play1447addrequiredicons3455 lib/playbook/props/percentage.rb
playbook_ui-13.34.1.pre.alpha.play1447addrequiredicons3451 lib/playbook/props/percentage.rb
playbook_ui-13.34.1.pre.alpha.PLAY14043436 lib/playbook/props/percentage.rb
playbook_ui-13.34.1.pre.alpha.pbntr258paginationkitforreact3413 lib/playbook/props/percentage.rb
playbook_ui-13.34.1.pre.alpha.pbntr258paginationkitforreact3411 lib/playbook/props/percentage.rb
playbook_ui-13.34.1.pre.alpha.pbntr258paginationkitforreact3409 lib/playbook/props/percentage.rb
playbook_ui-13.34.1.pre.alpha.pbntr258paginationkitforreact3404 lib/playbook/props/percentage.rb