Class: Io::Flow::V0::Models::SessionExperimentForm
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::SessionExperimentForm
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Instance Attribute Summary collapse
-
#key ⇒ Object
readonly
Returns the value of attribute key.
-
#variant ⇒ Object
readonly
Returns the value of attribute variant.
Instance Method Summary collapse
- #copy(incoming = {}) ⇒ Object
-
#initialize(incoming = {}) ⇒ SessionExperimentForm
constructor
A new instance of SessionExperimentForm.
- #to_hash ⇒ Object
- #to_json ⇒ Object
Constructor Details
#initialize(incoming = {}) ⇒ SessionExperimentForm
Returns a new instance of SessionExperimentForm.
65374 65375 65376 65377 65378 65379 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 65374 def initialize(incoming={}) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:key], 'SessionExperimentForm') @key = HttpClient::Preconditions.assert_class('key', opts.delete(:key), String) @variant = (x = opts.delete(:variant); x.nil? ? nil : (x = x; x.is_a?(::Io::Flow::V0::Models::SessionExperimentVariantForm) ? x : ::Io::Flow::V0::Models::SessionExperimentVariantForm.new(x))) end |
Instance Attribute Details
#key ⇒ Object (readonly)
Returns the value of attribute key.
65372 65373 65374 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 65372 def key @key end |
#variant ⇒ Object (readonly)
Returns the value of attribute variant.
65372 65373 65374 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 65372 def variant @variant end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
65385 65386 65387 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 65385 def copy(incoming={}) SessionExperimentForm.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#to_hash ⇒ Object
65389 65390 65391 65392 65393 65394 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 65389 def to_hash { :key => key, :variant => variant.nil? ? nil : variant.to_hash } end |
#to_json ⇒ Object
65381 65382 65383 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 65381 def to_json JSON.dump(to_hash) end |