Class: Travis::Rollout::ByPercent
- Inherits:
-
Struct
- Object
- Struct
- Travis::Rollout::ByPercent
- Defined in:
- lib/travis/rollout.rb
Instance Attribute Summary collapse
-
#env ⇒ Object
Returns the value of attribute env.
-
#name ⇒ Object
Returns the value of attribute name.
-
#redis ⇒ Object
Returns the value of attribute redis.
-
#value ⇒ Object
Returns the value of attribute value.
Instance Method Summary collapse
Instance Attribute Details
#env ⇒ Object
Returns the value of attribute env
58 59 60 |
# File 'lib/travis/rollout.rb', line 58 def env @env end |
#name ⇒ Object
Returns the value of attribute name
58 59 60 |
# File 'lib/travis/rollout.rb', line 58 def name @name end |
#redis ⇒ Object
Returns the value of attribute redis
58 59 60 |
# File 'lib/travis/rollout.rb', line 58 def redis @redis end |
#value ⇒ Object
Returns the value of attribute value
58 59 60 |
# File 'lib/travis/rollout.rb', line 58 def value @value end |
Instance Method Details
#matches? ⇒ Boolean
59 60 61 |
# File 'lib/travis/rollout.rb', line 59 def matches? !!value && value % 100 < percent end |
#percent ⇒ Object
63 64 65 66 |
# File 'lib/travis/rollout.rb', line 63 def percent percent = env.percent || redis.percent || -1 percent.to_i end |