Class: Portage::Ucp::Link

Inherits:
Data
  • Object
show all
Defined in:
lib/portage/ucp/value_objects.rb

Overview

schemas/shopping/types/link.json

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#titleObject (readonly)

Returns the value of attribute title

Returns:

  • (Object)

    the current value of title



202
203
204
# File 'lib/portage/ucp/value_objects.rb', line 202

def title
  @title
end

#typeObject (readonly)

Returns the value of attribute type

Returns:

  • (Object)

    the current value of type



202
203
204
# File 'lib/portage/ucp/value_objects.rb', line 202

def type
  @type
end

#urlObject (readonly)

Returns the value of attribute url

Returns:

  • (Object)

    the current value of url



202
203
204
# File 'lib/portage/ucp/value_objects.rb', line 202

def url
  @url
end

Instance Method Details

#to_wire_hObject



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