Class: Portage::Ucp::OrderConfirmation

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

Overview

schemas/shopping/types/order_confirmation.json — requires id/permalink_url. Carried on Checkout#order once complete_checkout actually produces an order; nil until then.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(id:, permalink_url:, label: nil) ⇒ OrderConfirmation

Returns a new instance of OrderConfirmation.



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

def initialize(id:, permalink_url:, label: nil) = super

Instance Attribute Details

#idObject (readonly)

Returns the value of attribute id

Returns:

  • (Object)

    the current value of id



395
396
397
# File 'lib/portage/ucp/value_objects.rb', line 395

def id
  @id
end

#labelObject (readonly)

Returns the value of attribute label

Returns:

  • (Object)

    the current value of label



395
396
397
# File 'lib/portage/ucp/value_objects.rb', line 395

def label
  @label
end

Returns the value of attribute permalink_url

Returns:

  • (Object)

    the current value of permalink_url



395
396
397
# File 'lib/portage/ucp/value_objects.rb', line 395

def permalink_url
  @permalink_url
end

Instance Method Details

#to_wire_hObject



398
399
400
401
402
# File 'lib/portage/ucp/value_objects.rb', line 398

def to_wire_h
  h = { "id" => id, "permalink_url" => permalink_url }
  h["label"] = label if label
  h
end