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.



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

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



42
43
44
# File 'lib/portage/ucp/value_objects.rb', line 42

def title
  @title
end

#typeObject (readonly)

Returns the value of attribute type

Returns:

  • (Object)

    the current value of type



42
43
44
# File 'lib/portage/ucp/value_objects.rb', line 42

def type
  @type
end

#urlObject (readonly)

Returns the value of attribute url

Returns:

  • (Object)

    the current value of url



42
43
44
# File 'lib/portage/ucp/value_objects.rb', line 42

def url
  @url
end

Instance Method Details

#to_wire_hObject



45
46
47
48
49
# File 'lib/portage/ucp/value_objects.rb', line 45

def to_wire_h
  h = { "type" => type, "url" => url }
  h["title"] = title if title
  h
end