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.
32409 32410 32411 32412 32413 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 32409 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.
32407 32408 32409 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 32407 def key @key end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
32419 32420 32421 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 32419 def copy(incoming={}) ExperimentVariant.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#to_hash ⇒ Object
32423 32424 32425 32426 32427 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 32423 def to_hash { :key => key } end |
#to_json ⇒ Object
32415 32416 32417 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 32415 def to_json JSON.dump(to_hash) end |