Class: Determinator::FixedDetermination
- Inherits:
-
Object
- Object
- Determinator::FixedDetermination
- Defined in:
- lib/determinator/fixed_determination.rb
Instance Attribute Summary collapse
-
#constraints ⇒ Object
readonly
Returns the value of attribute constraints.
-
#feature_on ⇒ Object
readonly
Returns the value of attribute feature_on.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#variant ⇒ Object
readonly
Returns the value of attribute variant.
Instance Method Summary collapse
- #==(other) ⇒ Object
-
#initialize(feature_on:, variant:, name: '', constraints: {}) ⇒ FixedDetermination
constructor
A new instance of FixedDetermination.
- #inspect ⇒ Object
- #to_explain_params ⇒ Object
Constructor Details
#initialize(feature_on:, variant:, name: '', constraints: {}) ⇒ FixedDetermination
Returns a new instance of FixedDetermination.
5 6 7 8 9 10 |
# File 'lib/determinator/fixed_determination.rb', line 5 def initialize(feature_on:, variant:, name: '', constraints: {}) @name = name @feature_on = feature_on @variant = variant @constraints = constraints end |
Instance Attribute Details
#constraints ⇒ Object (readonly)
Returns the value of attribute constraints.
3 4 5 |
# File 'lib/determinator/fixed_determination.rb', line 3 def constraints @constraints end |
#feature_on ⇒ Object (readonly)
Returns the value of attribute feature_on.
3 4 5 |
# File 'lib/determinator/fixed_determination.rb', line 3 def feature_on @feature_on end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
3 4 5 |
# File 'lib/determinator/fixed_determination.rb', line 3 def name @name end |
#variant ⇒ Object (readonly)
Returns the value of attribute variant.
3 4 5 |
# File 'lib/determinator/fixed_determination.rb', line 3 def variant @variant end |
Instance Method Details
#==(other) ⇒ Object
20 21 22 23 |
# File 'lib/determinator/fixed_determination.rb', line 20 def ==(other) return false unless other.is_a?(self.class) other.feature_on == feature_on && other.variant == variant && other.constraints == constraints end |
#inspect ⇒ Object
12 13 14 |
# File 'lib/determinator/fixed_determination.rb', line 12 def inspect "<feature_on: #{feature_on}, variant: #{variant}, constraints: #{constraints}" end |
#to_explain_params ⇒ Object
16 17 18 |
# File 'lib/determinator/fixed_determination.rb', line 16 def to_explain_params { name: name } end |