Class: Portage::Ucp::Link
- Inherits:
-
Data
- Object
- Data
- Portage::Ucp::Link
- Defined in:
- lib/portage/ucp/value_objects.rb
Overview
schemas/shopping/types/link.json
Instance Attribute Summary collapse
-
#title ⇒ Object
readonly
Returns the value of attribute title.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
-
#url ⇒ Object
readonly
Returns the value of attribute url.
Instance Method Summary collapse
-
#initialize(type:, url:, title: nil) ⇒ Link
constructor
A new instance of Link.
- #to_wire_h ⇒ Object
Constructor Details
#initialize(type:, url:, title: nil) ⇒ Link
Returns a new instance of Link.
203 |
# File 'lib/portage/ucp/value_objects.rb', line 203 def initialize(type:, url:, title: nil) = super |
Instance Attribute Details
#title ⇒ Object (readonly)
Returns the value of attribute title
202 203 204 |
# File 'lib/portage/ucp/value_objects.rb', line 202 def title @title end |
#type ⇒ Object (readonly)
Returns the value of attribute type
202 203 204 |
# File 'lib/portage/ucp/value_objects.rb', line 202 def type @type end |
#url ⇒ Object (readonly)
Returns the value of attribute url
202 203 204 |
# File 'lib/portage/ucp/value_objects.rb', line 202 def url @url end |
Instance Method Details
#to_wire_h ⇒ Object
205 206 207 208 209 |
# File 'lib/portage/ucp/value_objects.rb', line 205 def to_wire_h h = { "type" => type, "url" => url } h["title"] = title if title h end |