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.22.0 lib/playbook/props/percentage.rb
playbook_ui-13.21.0.pre.alpha.PBNTR243globalpositioningpropinset2504 lib/playbook/props/percentage.rb
playbook_ui-13.21.0.pre.alpha.PLAY12652489 lib/playbook/props/percentage.rb
playbook_ui-13.21.0.pre.alpha.PLAY12582474 lib/playbook/props/percentage.rb
playbook_ui-13.21.0.pre.alpha.PBNTR224letuserresetrowexpansion2466 lib/playbook/props/percentage.rb
playbook_ui-13.21.0.pre.alpha.PLAY120322465 lib/playbook/props/percentage.rb
playbook_ui-13.21.0.pre.alpha.pbntr220improveexpansionspeed2451 lib/playbook/props/percentage.rb
playbook_ui-13.21.0.pre.alpha.PBNTR224letuserresetrowexpansion2441 lib/playbook/props/percentage.rb
playbook_ui-13.21.0.pre.alpha.PBNTR225advancedtablefeedback2438 lib/playbook/props/percentage.rb
playbook_ui-13.21.0.pre.alpha.PBNTR238DatePickerYearBug2436 lib/playbook/props/percentage.rb
playbook_ui-13.21.0.pre.alpha.pbntr220improveexpansionspeed2431 lib/playbook/props/percentage.rb
playbook_ui-13.21.0.pre.alpha.pbntr220improveexpansionspeed2415 lib/playbook/props/percentage.rb
playbook_ui-13.20.0.pre.alpha.play1247htmloptions2404 lib/playbook/props/percentage.rb
playbook_ui-13.20.0.pre.alpha.play1247htmloptions2403 lib/playbook/props/percentage.rb
playbook_ui-13.20.0.pre.alpha.PLAY12572402 lib/playbook/props/percentage.rb
playbook_ui-13.21.0 lib/playbook/props/percentage.rb
playbook_ui-13.20.0.pre.alpha.PBNTR225advancedtablefeedback2375 lib/playbook/props/percentage.rb
playbook_ui-13.19.0.pre.alpha.PBNTR200addadvancedtablekitdarkmodestyles2346 lib/playbook/props/percentage.rb
playbook_ui-13.19.0.pre.alpha.play1174fixconfimationtoastmobilebug2345 lib/playbook/props/percentage.rb
playbook_ui-13.19.0.pre.alpha.play1174fixconfimationtoastmobilebug2342 lib/playbook/props/percentage.rb