Class: Io::Flow::V0::Models::SolidusVariantExportType

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

Overview

Exports variant level data for import into solidus

Instance Attribute Summary collapse

Attributes inherited from ExportType

#discriminator

Instance Method Summary collapse

Methods inherited from ExportType

from_json, #to_hash

Constructor Details

#initialize(incoming = {}) ⇒ SolidusVariantExportType

Returns a new instance of SolidusVariantExportType.



63662
63663
63664
63665
63666
63667
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 63662

def initialize(incoming={})
  super(:discriminator => ExportType::Types::SOLIDUS_VARIANT_EXPORT_TYPE)
  opts = HttpClient::Helper.symbolize_keys(incoming)
  @numbers = (x = opts.delete(:numbers); x.nil? ? nil : HttpClient::Preconditions.assert_class('numbers', x, Array).map { |v| HttpClient::Preconditions.assert_class('numbers', v, String) })
  @sort = (x = opts.delete(:sort); x.nil? ? nil : HttpClient::Preconditions.assert_class('sort', x, String))
end

Instance Attribute Details

#numbersObject (readonly)

Returns the value of attribute numbers.



63660
63661
63662
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 63660

def numbers
  @numbers
end

#sortObject (readonly)

Returns the value of attribute sort.



63660
63661
63662
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 63660

def sort
  @sort
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



63673
63674
63675
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 63673

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

#subtype_to_hashObject



63677
63678
63679
63680
63681
63682
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 63677

def subtype_to_hash
  {
    :numbers => numbers.nil? ? nil : numbers,
    :sort => sort
  }
end

#to_jsonObject



63669
63670
63671
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 63669

def to_json
  JSON.dump(to_hash)
end