Class: ABMeter::Core::AssignmentConfig::Space
- Inherits:
-
Object
- Object
- ABMeter::Core::AssignmentConfig::Space
- Defined in:
- lib/abmeter/core/assignment_config/space.rb
Instance Attribute Summary collapse
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#salt ⇒ Object
readonly
Returns the value of attribute salt.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(id:, salt:) ⇒ Space
constructor
A new instance of Space.
- #serialize ⇒ Object
Constructor Details
#initialize(id:, salt:) ⇒ Space
Returns a new instance of Space.
9 10 11 12 |
# File 'lib/abmeter/core/assignment_config/space.rb', line 9 def initialize(id:, salt:) @id = id @salt = salt end |
Instance Attribute Details
#id ⇒ Object (readonly)
Returns the value of attribute id.
7 8 9 |
# File 'lib/abmeter/core/assignment_config/space.rb', line 7 def id @id end |
#salt ⇒ Object (readonly)
Returns the value of attribute salt.
7 8 9 |
# File 'lib/abmeter/core/assignment_config/space.rb', line 7 def salt @salt end |
Class Method Details
.from_json(json) ⇒ Object
14 15 16 17 18 19 20 21 |
# File 'lib/abmeter/core/assignment_config/space.rb', line 14 def self.from_json(json) json.map do |space| new( id: space[:id], salt: space[:salt] ) end end |
Instance Method Details
#serialize ⇒ Object
23 24 25 26 27 28 |
# File 'lib/abmeter/core/assignment_config/space.rb', line 23 def serialize { id: id, salt: salt } end |