Class: Flipper::GateValues
- Inherits:
-
Object
- Object
- Flipper::GateValues
- Defined in:
- lib/flipper/gate_values.rb
Instance Attribute Summary collapse
-
#actors ⇒ Object
readonly
Returns the value of attribute actors.
-
#boolean ⇒ Object
readonly
Returns the value of attribute boolean.
-
#expression ⇒ Object
readonly
Returns the value of attribute expression.
-
#groups ⇒ Object
readonly
Returns the value of attribute groups.
-
#percentage_of_actors ⇒ Object
readonly
Returns the value of attribute percentage_of_actors.
-
#percentage_of_time ⇒ Object
readonly
Returns the value of attribute percentage_of_time.
Instance Method Summary collapse
- #eql?(other) ⇒ Boolean (also: #==)
-
#initialize(adapter_values) ⇒ GateValues
constructor
A new instance of GateValues.
Constructor Details
#initialize(adapter_values) ⇒ GateValues
Returns a new instance of GateValues.
13 14 15 16 17 18 19 20 |
# File 'lib/flipper/gate_values.rb', line 13 def initialize(adapter_values) @boolean = Typecast.to_boolean(adapter_values[:boolean]) @actors = Typecast.to_set(adapter_values[:actors]) @groups = Typecast.to_set(adapter_values[:groups]) @expression = adapter_values[:expression] @percentage_of_actors = Typecast.to_number(adapter_values[:percentage_of_actors]) @percentage_of_time = Typecast.to_number(adapter_values[:percentage_of_time]) end |
Instance Attribute Details
#actors ⇒ Object (readonly)
Returns the value of attribute actors.
7 8 9 |
# File 'lib/flipper/gate_values.rb', line 7 def actors @actors end |
#boolean ⇒ Object (readonly)
Returns the value of attribute boolean.
6 7 8 |
# File 'lib/flipper/gate_values.rb', line 6 def boolean @boolean end |
#expression ⇒ Object (readonly)
Returns the value of attribute expression.
9 10 11 |
# File 'lib/flipper/gate_values.rb', line 9 def expression @expression end |
#groups ⇒ Object (readonly)
Returns the value of attribute groups.
8 9 10 |
# File 'lib/flipper/gate_values.rb', line 8 def groups @groups end |
#percentage_of_actors ⇒ Object (readonly)
Returns the value of attribute percentage_of_actors.
10 11 12 |
# File 'lib/flipper/gate_values.rb', line 10 def percentage_of_actors @percentage_of_actors end |
#percentage_of_time ⇒ Object (readonly)
Returns the value of attribute percentage_of_time.
11 12 13 |
# File 'lib/flipper/gate_values.rb', line 11 def percentage_of_time @percentage_of_time end |
Instance Method Details
#eql?(other) ⇒ Boolean Also known as: ==
22 23 24 25 26 27 28 29 30 |
# File 'lib/flipper/gate_values.rb', line 22 def eql?(other) self.class.eql?(other.class) && boolean == other.boolean && actors == other.actors && groups == other.groups && expression == other.expression && percentage_of_actors == other.percentage_of_actors && percentage_of_time == other.percentage_of_time end |