Class: TestTrack::Assignment
- Inherits:
-
Object
- Object
- TestTrack::Assignment
- Includes:
- RequiredOptions
- Defined in:
- app/models/test_track/assignment.rb
Instance Attribute Summary collapse
-
#context ⇒ Object
Returns the value of attribute context.
-
#split_name ⇒ Object
readonly
Returns the value of attribute split_name.
- #variant ⇒ Object
-
#visitor ⇒ Object
readonly
Returns the value of attribute visitor.
Instance Method Summary collapse
- #feature_gate? ⇒ Boolean
-
#initialize(opts = {}) ⇒ Assignment
constructor
A new instance of Assignment.
- #unsynced? ⇒ Boolean
Constructor Details
#initialize(opts = {}) ⇒ Assignment
Returns a new instance of Assignment.
8 9 10 11 12 |
# File 'app/models/test_track/assignment.rb', line 8 def initialize(opts = {}) @visitor = require_option!(opts, :visitor) @split_name = require_option!(opts, :split_name).to_s raise ArgumentError, "unknown opts: #{opts.keys.to_sentence}" if opts.present? end |
Instance Attribute Details
#context ⇒ Object
Returns the value of attribute context.
4 5 6 |
# File 'app/models/test_track/assignment.rb', line 4 def context @context end |
#split_name ⇒ Object (readonly)
Returns the value of attribute split_name.
5 6 7 |
# File 'app/models/test_track/assignment.rb', line 5 def split_name @split_name end |
#variant ⇒ Object
14 15 16 |
# File 'app/models/test_track/assignment.rb', line 14 def variant @variant ||= _variant end |
#visitor ⇒ Object (readonly)
Returns the value of attribute visitor.
5 6 7 |
# File 'app/models/test_track/assignment.rb', line 5 def visitor @visitor end |
Instance Method Details
#feature_gate? ⇒ Boolean
22 23 24 |
# File 'app/models/test_track/assignment.rb', line 22 def feature_gate? split_name.end_with?('_enabled') end |
#unsynced? ⇒ Boolean
18 19 20 |
# File 'app/models/test_track/assignment.rb', line 18 def unsynced? true end |