Class: Portage::Ucp::Price

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

Overview

schemas/shopping/types/price.json — the wire-shape counterpart to Money above: an integer minor-unit amount paired with its currency, appearing directly in Product/Variant payloads.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#amountObject (readonly)

Returns the value of attribute amount

Returns:

  • (Object)

    the current value of amount



14
15
16
# File 'lib/portage/ucp/value_objects.rb', line 14

def amount
  @amount
end

#currencyObject (readonly)

Returns the value of attribute currency

Returns:

  • (Object)

    the current value of currency



14
15
16
# File 'lib/portage/ucp/value_objects.rb', line 14

def currency
  @currency
end

Instance Method Details

#to_wire_hObject



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

def to_wire_h = { "amount" => amount, "currency" => currency }