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.



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

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



65
66
67
# File 'lib/portage/ucp/value_objects.rb', line 65

def id
  @id
end

#labelObject (readonly)

Returns the value of attribute label

Returns:

  • (Object)

    the current value of label



65
66
67
# File 'lib/portage/ucp/value_objects.rb', line 65

def label
  @label
end

Returns the value of attribute permalink_url

Returns:

  • (Object)

    the current value of permalink_url



65
66
67
# File 'lib/portage/ucp/value_objects.rb', line 65

def permalink_url
  @permalink_url
end

Instance Method Details

#to_wire_hObject



68
69
70
71
72
# File 'lib/portage/ucp/value_objects.rb', line 68

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