Class: Io::Flow::V0::Models::SessionExperimentVariant
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::SessionExperimentVariant
- 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 = {}) ⇒ SessionExperimentVariant
constructor
A new instance of SessionExperimentVariant.
- #to_hash ⇒ Object
- #to_json ⇒ Object
Constructor Details
#initialize(incoming = {}) ⇒ SessionExperimentVariant
Returns a new instance of SessionExperimentVariant.
30252 30253 30254 30255 30256 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 30252 def initialize(incoming={}) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:key], 'SessionExperimentVariant') @key = HttpClient::Preconditions.assert_class('key', opts.delete(:key), String) end |
Instance Attribute Details
#key ⇒ Object (readonly)
Returns the value of attribute key.
30250 30251 30252 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 30250 def key @key end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
30262 30263 30264 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 30262 def copy(incoming={}) SessionExperimentVariant.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#to_hash ⇒ Object
30266 30267 30268 30269 30270 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 30266 def to_hash { :key => key } end |
#to_json ⇒ Object
30258 30259 30260 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 30258 def to_json JSON.dump(to_hash) end |