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.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
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.
46906 46907 46908 46909 46910 46911 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 46906 def initialize(incoming={}) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:key, :name], 'SessionExperimentVariant') @key = HttpClient::Preconditions.assert_class('key', opts.delete(:key), String) @name = HttpClient::Preconditions.assert_class('name', opts.delete(:name), String) end |
Instance Attribute Details
#key ⇒ Object (readonly)
Returns the value of attribute key.
46904 46905 46906 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 46904 def key @key end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
46904 46905 46906 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 46904 def name @name end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
46917 46918 46919 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 46917 def copy(incoming={}) SessionExperimentVariant.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#to_hash ⇒ Object
46921 46922 46923 46924 46925 46926 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 46921 def to_hash { :key => key, :name => name } end |
#to_json ⇒ Object
46913 46914 46915 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 46913 def to_json JSON.dump(to_hash) end |