Class: ABMeter::Core::AssignmentConfig::Config
- Inherits:
-
Object
- Object
- ABMeter::Core::AssignmentConfig::Config
- Defined in:
- lib/abmeter/core/assignment_config.rb
Instance Attribute Summary collapse
-
#experiments ⇒ Object
readonly
Returns the value of attribute experiments.
-
#feature_flags ⇒ Object
readonly
Returns the value of attribute feature_flags.
-
#parameters ⇒ Object
readonly
Returns the value of attribute parameters.
-
#spaces ⇒ Object
readonly
Returns the value of attribute spaces.
Instance Method Summary collapse
-
#initialize(feature_flags:, experiments:, parameters:, spaces:) ⇒ Config
constructor
A new instance of Config.
- #serialize ⇒ Object
- #to_json(*_) ⇒ Object
Constructor Details
#initialize(feature_flags:, experiments:, parameters:, spaces:) ⇒ Config
Returns a new instance of Config.
11 12 13 14 15 16 |
# File 'lib/abmeter/core/assignment_config.rb', line 11 def initialize(feature_flags:, experiments:, parameters:, spaces:) @feature_flags = feature_flags @experiments = experiments @parameters = parameters @spaces = spaces end |
Instance Attribute Details
#experiments ⇒ Object (readonly)
Returns the value of attribute experiments.
9 10 11 |
# File 'lib/abmeter/core/assignment_config.rb', line 9 def experiments @experiments end |
#feature_flags ⇒ Object (readonly)
Returns the value of attribute feature_flags.
9 10 11 |
# File 'lib/abmeter/core/assignment_config.rb', line 9 def feature_flags @feature_flags end |
#parameters ⇒ Object (readonly)
Returns the value of attribute parameters.
9 10 11 |
# File 'lib/abmeter/core/assignment_config.rb', line 9 def parameters @parameters end |
#spaces ⇒ Object (readonly)
Returns the value of attribute spaces.
9 10 11 |
# File 'lib/abmeter/core/assignment_config.rb', line 9 def spaces @spaces end |
Instance Method Details
#serialize ⇒ Object
22 23 24 25 26 27 28 29 |
# File 'lib/abmeter/core/assignment_config.rb', line 22 def serialize { spaces: spaces.sort_by(&:id).map(&:serialize), parameters: parameters.sort_by(&:id).map(&:serialize), feature_flags: feature_flags.sort_by(&:id).map(&:serialize), experiments: experiments.sort_by(&:id).map(&:serialize) } end |
#to_json(*_) ⇒ Object
18 19 20 |
# File 'lib/abmeter/core/assignment_config.rb', line 18 def to_json(*_) serialize.to_json end |