Class: Portage::Ucp::Description
- Inherits:
-
Data
- Object
- Data
- Portage::Ucp::Description
- Defined in:
- lib/portage/ucp/value_objects.rb
Overview
schemas/shopping/types/description.json — the spec requires at least one of plain/html/markdown; that's a request-time authoring concern this value object doesn't enforce, same posture as PostalAddress leaving every field optional.
Instance Attribute Summary collapse
-
#html ⇒ Object
readonly
Returns the value of attribute html.
-
#markdown ⇒ Object
readonly
Returns the value of attribute markdown.
-
#plain ⇒ Object
readonly
Returns the value of attribute plain.
Instance Method Summary collapse
-
#initialize(plain: nil, html: nil, markdown: nil) ⇒ Description
constructor
A new instance of Description.
- #to_wire_h ⇒ Object
Constructor Details
#initialize(plain: nil, html: nil, markdown: nil) ⇒ Description
Returns a new instance of Description.
28 |
# File 'lib/portage/ucp/value_objects.rb', line 28 def initialize(plain: nil, html: nil, markdown: nil) = super |
Instance Attribute Details
#html ⇒ Object (readonly)
Returns the value of attribute html
27 28 29 |
# File 'lib/portage/ucp/value_objects.rb', line 27 def html @html end |
#markdown ⇒ Object (readonly)
Returns the value of attribute markdown
27 28 29 |
# File 'lib/portage/ucp/value_objects.rb', line 27 def markdown @markdown end |
#plain ⇒ Object (readonly)
Returns the value of attribute plain
27 28 29 |
# File 'lib/portage/ucp/value_objects.rb', line 27 def plain @plain end |
Instance Method Details
#to_wire_h ⇒ Object
30 |
# File 'lib/portage/ucp/value_objects.rb', line 30 def to_wire_h = { "plain" => plain, "html" => html, "markdown" => markdown }.compact |