Sha256: 479c96eba4354e3ae4752ebc65773e73939056971d9e70e3574fcfad64b0bc02

Contents?: true

Size: 355 Bytes

Versions: 5

Compression:

Stored size: 355 Bytes

Contents

module Flipper
  module Types
    class Percentage < Type
      def initialize(value)
        value = Typecast.to_integer(value)

        if value < 0 || value > 100
          raise ArgumentError,
                "value must be a positive number less than or equal to 100, but was #{value}"
        end

        @value = value
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
flipper-0.11.0.beta6 lib/flipper/types/percentage.rb
flipper-0.11.0.beta5 lib/flipper/types/percentage.rb
flipper-0.11.0.beta4 lib/flipper/types/percentage.rb
flipper-0.11.0.beta3 lib/flipper/types/percentage.rb
flipper-0.11.0.beta1 lib/flipper/types/percentage.rb