Class: Io::Flow::V0::Models::CatalogItemCountryStatesData

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

Returns a new instance of CatalogItemCountryStatesData.



14366
14367
14368
14369
14370
14371
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14366

def initialize(incoming={})
  opts = HttpClient::Helper.symbolize_keys(incoming)
  HttpClient::Preconditions.require_keys(opts, [:item_number, :countries], 'CatalogItemCountryStatesData')
  @item_number = HttpClient::Preconditions.assert_class('item_number', opts.delete(:item_number), String)
  @countries = HttpClient::Preconditions.assert_class('countries', opts.delete(:countries), Array).map { |v| (x = v; x.is_a?(::Io::Flow::V0::Models::CatalogItemCountryStates) ? x : ::Io::Flow::V0::Models::CatalogItemCountryStates.new(x)) }
end

Instance Attribute Details

#countriesObject (readonly)

Returns the value of attribute countries.



14364
14365
14366
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14364

def countries
  @countries
end

#item_numberObject (readonly)

Returns the value of attribute item_number.



14364
14365
14366
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14364

def item_number
  @item_number
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



14377
14378
14379
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14377

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

#to_hashObject



14381
14382
14383
14384
14385
14386
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14381

def to_hash
  {
    :item_number => item_number,
    :countries => countries.map { |o| o.to_hash }
  }
end

#to_jsonObject



14373
14374
14375
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14373

def to_json
  JSON.dump(to_hash)
end