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-7.0.0.pre.alpha3 app/pb_kits/playbook/props/percentage.rb
playbook_ui-7.0.0.pre.alpha2 app/pb_kits/playbook/props/percentage.rb
playbook_ui-6.3.0 app/pb_kits/playbook/props/percentage.rb
playbook_ui-6.2.1 app/pb_kits/playbook/props/percentage.rb
playbook_ui-6.2.0 app/pb_kits/playbook/props/percentage.rb
playbook_ui-7.0.0.pre.alpha1 app/pb_kits/playbook/props/percentage.rb
playbook_ui-6.1.0.pre.alpha5 app/pb_kits/playbook/props/percentage.rb
playbook_ui-6.1.0.pre.alpha4 app/pb_kits/playbook/props/percentage.rb
playbook_ui-6.1.0.pre.alpha3 app/pb_kits/playbook/props/percentage.rb
playbook_ui-6.1.0.pre.alpha2 app/pb_kits/playbook/props/percentage.rb
playbook_ui-6.1.0.pre.alpha1 app/pb_kits/playbook/props/percentage.rb
playbook_ui-6.1.0 app/pb_kits/playbook/props/percentage.rb
playbook_ui-6.0.1.pre.alpha6 app/pb_kits/playbook/props/percentage.rb
playbook_ui-6.0.1.pre.alpha5 app/pb_kits/playbook/props/percentage.rb
playbook_ui-6.0.1.pre.alpha4 app/pb_kits/playbook/props/percentage.rb
playbook_ui-6.0.1.pre.alpha3 app/pb_kits/playbook/props/percentage.rb
playbook_ui-6.0.1.pre.alpha2 app/pb_kits/playbook/props/percentage.rb
playbook_ui-5.2.0.pre.alpha15 app/pb_kits/playbook/props/percentage.rb
playbook_ui-5.2.0.pre.alpha14 app/pb_kits/playbook/props/percentage.rb
playbook_ui-5.2.0.pre.alpha13 app/pb_kits/playbook/props/percentage.rb