Class: Portage::Ucp::Total
- Inherits:
-
Data
- Object
- Data
- Portage::Ucp::Total
- Defined in:
- lib/portage/ucp/value_objects.rb
Overview
One cost-breakdown entry (schemas/shopping/types/total.json). amount is a
signed integer in the parent object's currency's minor units.
Instance Attribute Summary collapse
-
#amount ⇒ Object
readonly
Returns the value of attribute amount.
-
#display_text ⇒ Object
readonly
Returns the value of attribute display_text.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Instance Method Summary collapse
-
#initialize(type:, amount:, display_text: nil) ⇒ Total
constructor
A new instance of Total.
- #to_wire_h ⇒ Object
Constructor Details
#initialize(type:, amount:, display_text: nil) ⇒ Total
Returns a new instance of Total.
11 |
# File 'lib/portage/ucp/value_objects.rb', line 11 def initialize(type:, amount:, display_text: nil) = super |
Instance Attribute Details
#amount ⇒ Object (readonly)
Returns the value of attribute amount
10 11 12 |
# File 'lib/portage/ucp/value_objects.rb', line 10 def amount @amount end |
#display_text ⇒ Object (readonly)
Returns the value of attribute display_text
10 11 12 |
# File 'lib/portage/ucp/value_objects.rb', line 10 def display_text @display_text end |
#type ⇒ Object (readonly)
Returns the value of attribute type
10 11 12 |
# File 'lib/portage/ucp/value_objects.rb', line 10 def type @type end |
Instance Method Details
#to_wire_h ⇒ Object
13 14 15 16 17 |
# File 'lib/portage/ucp/value_objects.rb', line 13 def to_wire_h h = { "type" => type, "amount" => amount } h["display_text"] = display_text if display_text h end |