Class: Io::Flow::V0::Models::ExperimentVariant
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::ExperimentVariant
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Overview
Experiment variant. Control or variant
Instance Attribute Summary collapse
-
#key ⇒ Object
readonly
Returns the value of attribute key.
Instance Method Summary collapse
- #copy(incoming = {}) ⇒ Object
-
#initialize(incoming = {}) ⇒ ExperimentVariant
constructor
A new instance of ExperimentVariant.
- #to_hash ⇒ Object
- #to_json ⇒ Object
Constructor Details
#initialize(incoming = {}) ⇒ ExperimentVariant
Returns a new instance of ExperimentVariant.
32360 32361 32362 32363 32364 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 32360 def initialize(incoming={}) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:key], 'ExperimentVariant') @key = HttpClient::Preconditions.assert_class('key', opts.delete(:key), String) end |
Instance Attribute Details
#key ⇒ Object (readonly)
Returns the value of attribute key.
32358 32359 32360 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 32358 def key @key end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
32370 32371 32372 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 32370 def copy(incoming={}) ExperimentVariant.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#to_hash ⇒ Object
32374 32375 32376 32377 32378 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 32374 def to_hash { :key => key } end |
#to_json ⇒ Object
32366 32367 32368 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 32366 def to_json JSON.dump(to_hash) end |