Class: Io::Flow::V0::Models::CheckoutAttributeForm

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 = {}) ⇒ CheckoutAttributeForm



16284
16285
16286
16287
16288
16289
16290
16291
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16284

def initialize(incoming={})
  opts = HttpClient::Helper.symbolize_keys(incoming)
  HttpClient::Preconditions.require_keys(opts, [:key, :experience_key, :attribute_keys], 'CheckoutAttributeForm')
  @key = HttpClient::Preconditions.assert_class('key', opts.delete(:key), String)
  @experience_key = HttpClient::Preconditions.assert_class('experience_key', opts.delete(:experience_key), String)
  @attribute_keys = HttpClient::Preconditions.assert_class('attribute_keys', opts.delete(:attribute_keys), Array).map { |v| HttpClient::Preconditions.assert_class('attribute_keys', v, String) }
  @position = (x = opts.delete(:position); x.nil? ? nil : HttpClient::Preconditions.assert_class('position', x, Integer))
end

Instance Attribute Details

#attribute_keysObject (readonly)

Returns the value of attribute attribute_keys.



16282
16283
16284
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16282

def attribute_keys
  @attribute_keys
end

#experience_keyObject (readonly)

Returns the value of attribute experience_key.



16282
16283
16284
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16282

def experience_key
  @experience_key
end

#keyObject (readonly)

Returns the value of attribute key.



16282
16283
16284
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16282

def key
  @key
end

#positionObject (readonly)

Returns the value of attribute position.



16282
16283
16284
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16282

def position
  @position
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



16297
16298
16299
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16297

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

#to_hashObject



16301
16302
16303
16304
16305
16306
16307
16308
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16301

def to_hash
  {
    :key => key,
    :experience_key => experience_key,
    :attribute_keys => attribute_keys,
    :position => position
  }
end

#to_jsonObject



16293
16294
16295
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16293

def to_json
  JSON.dump(to_hash)
end