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

Returns a new instance of CheckoutAttributeForm.



35939
35940
35941
35942
35943
35944
35945
35946
35947
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 35939

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)
  @name = (x = opts.delete(:name); x.nil? ? nil : HttpClient::Preconditions.assert_class('name', x, 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.



35937
35938
35939
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 35937

def attribute_keys
  @attribute_keys
end

#experience_keyObject (readonly)

Returns the value of attribute experience_key.



35937
35938
35939
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 35937

def experience_key
  @experience_key
end

#keyObject (readonly)

Returns the value of attribute key.



35937
35938
35939
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 35937

def key
  @key
end

#nameObject (readonly)

Returns the value of attribute name.



35937
35938
35939
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 35937

def name
  @name
end

#positionObject (readonly)

Returns the value of attribute position.



35937
35938
35939
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 35937

def position
  @position
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



35953
35954
35955
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 35953

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

#to_hashObject



35957
35958
35959
35960
35961
35962
35963
35964
35965
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 35957

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

#to_jsonObject



35949
35950
35951
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 35949

def to_json
  JSON.dump(to_hash)
end