Sha256: 696fc725968dce79c356a6b2f0bf072f4b838c7f89b0819980510ef88e42433e

Contents?: true

Size: 339 Bytes

Versions: 17

Compression:

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

17 entries across 17 versions & 1 rubygems

Version Path
flipper-0.10.2 lib/flipper/types/percentage.rb
flipper-0.10.1 lib/flipper/types/percentage.rb
flipper-0.10.0 lib/flipper/types/percentage.rb
flipper-0.9.2 lib/flipper/types/percentage.rb
flipper-0.9.1 lib/flipper/types/percentage.rb
flipper-0.9.0 lib/flipper/types/percentage.rb
flipper-0.9.0.beta1 lib/flipper/types/percentage.rb
flipper-0.8.0 lib/flipper/types/percentage.rb
flipper-0.7.5 lib/flipper/types/percentage.rb
flipper-0.7.4 lib/flipper/types/percentage.rb
flipper-0.7.3 lib/flipper/types/percentage.rb
flipper-0.7.2 lib/flipper/types/percentage.rb
flipper-0.7.1 lib/flipper/types/percentage.rb
flipper-0.7.0 lib/flipper/types/percentage.rb
flipper-0.7.0.beta6 lib/flipper/types/percentage.rb
flipper-0.7.0.beta5 lib/flipper/types/percentage.rb
flipper-0.7.0.beta4 lib/flipper/types/percentage.rb