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.



68660
68661
68662
68663
68664
68665
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 68660

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.



68658
68659
68660
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 68658

def numbers
  @numbers
end

#sortObject (readonly)

Returns the value of attribute sort.



68658
68659
68660
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 68658

def sort
  @sort
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



68671
68672
68673
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 68671

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

#subtype_to_hashObject



68675
68676
68677
68678
68679
68680
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 68675

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

#to_jsonObject



68667
68668
68669
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 68667

def to_json
  JSON.dump(to_hash)
end