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.
32261 32262 32263 32264 32265 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 32261 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.
32259 32260 32261 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 32259 def key @key end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
32271 32272 32273 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 32271 def copy(incoming={}) ExperimentVariant.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#to_hash ⇒ Object
32275 32276 32277 32278 32279 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 32275 def to_hash { :key => key } end |
#to_json ⇒ Object
32267 32268 32269 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 32267 def to_json JSON.dump(to_hash) end |