Class: Io::Flow::V0::Models::SessionExperimentVariantForm

Inherits:
Object
  • Object
show all
Defined in:
lib/flow_commerce/flow_api_v0_client.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(incoming = {}) ⇒ SessionExperimentVariantForm

Returns a new instance of SessionExperimentVariantForm.



58171
58172
58173
58174
58175
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 58171

def initialize(incoming={})
  opts = HttpClient::Helper.symbolize_keys(incoming)
  HttpClient::Preconditions.require_keys(opts, [:key], 'SessionExperimentVariantForm')
  @key = HttpClient::Preconditions.assert_class('key', opts.delete(:key), String)
end

Instance Attribute Details

#keyObject (readonly)

Returns the value of attribute key.



58169
58170
58171
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 58169

def key
  @key
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



58181
58182
58183
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 58181

def copy(incoming={})
  SessionExperimentVariantForm.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
end

#to_hashObject



58185
58186
58187
58188
58189
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 58185

def to_hash
  {
    :key => key
  }
end

#to_jsonObject



58177
58178
58179
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 58177

def to_json
  JSON.dump(to_hash)
end