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.
171 |
# File 'lib/portage/ucp/value_objects.rb', line 171 def initialize(type:, amount:, display_text: nil) = super |
Instance Attribute Details
#amount ⇒ Object (readonly)
Returns the value of attribute amount
170 171 172 |
# File 'lib/portage/ucp/value_objects.rb', line 170 def amount @amount end |
#display_text ⇒ Object (readonly)
Returns the value of attribute display_text
170 171 172 |
# File 'lib/portage/ucp/value_objects.rb', line 170 def display_text @display_text end |
#type ⇒ Object (readonly)
Returns the value of attribute type
170 171 172 |
# File 'lib/portage/ucp/value_objects.rb', line 170 def type @type end |
Instance Method Details
#to_wire_h ⇒ Object
173 174 175 176 177 |
# File 'lib/portage/ucp/value_objects.rb', line 173 def to_wire_h h = { "type" => type, "amount" => amount } h["display_text"] = display_text if display_text h end |