Class: Portage::Ucp::RetailLocation

Inherits:
Data
  • Object
show all
Defined in:
lib/portage/ucp/value_objects.rb

Overview

schemas/shopping/types/retail_location.json — the pickup counterpart to ShippingDestination; only address is optional.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(id:, name:, address: nil) ⇒ RetailLocation

Returns a new instance of RetailLocation.



264
# File 'lib/portage/ucp/value_objects.rb', line 264

def initialize(id:, name:, address: nil) = super

Instance Attribute Details

#addressObject (readonly)

Returns the value of attribute address

Returns:

  • (Object)

    the current value of address



263
264
265
# File 'lib/portage/ucp/value_objects.rb', line 263

def address
  @address
end

#idObject (readonly)

Returns the value of attribute id

Returns:

  • (Object)

    the current value of id



263
264
265
# File 'lib/portage/ucp/value_objects.rb', line 263

def id
  @id
end

#nameObject (readonly)

Returns the value of attribute name

Returns:

  • (Object)

    the current value of name



263
264
265
# File 'lib/portage/ucp/value_objects.rb', line 263

def name
  @name
end

Instance Method Details

#to_wire_hObject



266
267
268
269
270
# File 'lib/portage/ucp/value_objects.rb', line 266

def to_wire_h
  h = { "id" => id, "name" => name }
  h["address"] = address.to_wire_h if address
  h
end