Sha256: 11d8a6bbb28d4f1366e28cf418172488593f09cf94559f35b967e2fb84cb8712

Contents?: true

Size: 358 Bytes

Versions: 12

Compression:

Stored size: 358 Bytes

Contents

module Flipper
  module Types
    class Percentage < Type
      def initialize(value)
        value = Typecast.to_percentage(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

12 entries across 12 versions & 1 rubygems

Version Path
flipper-0.15.0 lib/flipper/types/percentage.rb
flipper-0.14.0 lib/flipper/types/percentage.rb
flipper-0.13.0 lib/flipper/types/percentage.rb
flipper-0.13.0.beta1 lib/flipper/types/percentage.rb
flipper-0.12.2 lib/flipper/types/percentage.rb
flipper-0.12.1 lib/flipper/types/percentage.rb
flipper-0.12.0 lib/flipper/types/percentage.rb
flipper-0.11.0 lib/flipper/types/percentage.rb
flipper-0.11.0.rc1 lib/flipper/types/percentage.rb
flipper-0.11.0.beta9 lib/flipper/types/percentage.rb
flipper-0.11.0.beta8 lib/flipper/types/percentage.rb
flipper-0.11.0.beta7 lib/flipper/types/percentage.rb