Class: Flipper::Types::Percentage

Inherits:
Flipper::Type show all
Defined in:
lib/flipper/types/percentage.rb

Direct Known Subclasses

PercentageOfActors, PercentageOfRandom

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(value) ⇒ Percentage

Returns a new instance of Percentage.



6
7
8
# File 'lib/flipper/types/percentage.rb', line 6

def initialize(value)
  @value = value.to_i
end

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



4
5
6
# File 'lib/flipper/types/percentage.rb', line 4

def value
  @value
end

Instance Method Details

#disabled_valueObject



14
15
16
# File 'lib/flipper/types/percentage.rb', line 14

def disabled_value
  0
end

#enabled_valueObject



10
11
12
# File 'lib/flipper/types/percentage.rb', line 10

def enabled_value
  value
end