Class: Portage::Ucp::Description

Inherits:
Data
  • Object
show all
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

Instance Method Summary collapse

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

#htmlObject (readonly)

Returns the value of attribute html

Returns:

  • (Object)

    the current value of html



27
28
29
# File 'lib/portage/ucp/value_objects.rb', line 27

def html
  @html
end

#markdownObject (readonly)

Returns the value of attribute markdown

Returns:

  • (Object)

    the current value of markdown



27
28
29
# File 'lib/portage/ucp/value_objects.rb', line 27

def markdown
  @markdown
end

#plainObject (readonly)

Returns the value of attribute plain

Returns:

  • (Object)

    the current value of plain



27
28
29
# File 'lib/portage/ucp/value_objects.rb', line 27

def plain
  @plain
end

Instance Method Details

#to_wire_hObject



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

def to_wire_h = { "plain" => plain, "html" => html, "markdown" => markdown }.compact