Class: Mws::Apis::Feeds::Inventory::Fulfillment

Inherits:
Object
  • Object
show all
Defined in:
lib/mws/apis/feeds/inventory.rb

Constant Summary collapse

Type =
Mws::Enum.for afn: 'AFN', mfn: 'MFN'

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(center, latency, type) ⇒ Fulfillment

Returns a new instance of Fulfillment.



42
43
44
45
46
47
48
49
50
# File 'lib/mws/apis/feeds/inventory.rb', line 42

def initialize(center, latency, type)
  @center = center
  @latency = latency
  unless @latency.nil? or (@latency.to_i == @latency and @latency > 0)
    raise Mws::Errors::ValidationError.new('Fulfillment latency must be a whole number greater than zero.')
  end
  @type = Type.for(type)
  raise Mws::Errors::ValidationError.new("Fulfillment type must be either 'AFN' or 'MFN'.") if type and @type.nil?
end

Instance Attribute Details

#centerObject (readonly)

Returns the value of attribute center.



38
39
40
# File 'lib/mws/apis/feeds/inventory.rb', line 38

def center
  @center
end

#latencyObject (readonly)

Returns the value of attribute latency.



38
39
40
# File 'lib/mws/apis/feeds/inventory.rb', line 38

def latency
  @latency
end