Class: Udb::DocLink

Inherits:
Object
  • Object
show all
Defined in:
lib/udb/doc_link.rb

Instance Method Summary collapse

Constructor Details

#initialize(dst_link, db_obj) ⇒ DocLink

Returns a new instance of DocLink.

Parameters:

  • dst_link (String)

    The documentation link provided in the YAML

  • db_obj (String)

    Database object

Raises:

  • (ArgumentError)


37
38
39
40
41
42
# File 'lib/udb/doc_link.rb', line 37

def initialize(dst_link, db_obj)
  raise ArgumentError, "Need String but was passed a #{data.class}" unless dst_link.is_a?(String)
  @dst_link = dst_link

  raise ArgumentError, "Missing documentation link for #{db_obj.name} of kind #{db_obj.kind}" if @dst_link.nil?
end

Instance Method Details

Returns Unique ID of the linked to normative rule.

Returns:

  • (String)

    Unique ID of the linked to normative rule



45
# File 'lib/udb/doc_link.rb', line 45

def dst_link = @dst_link

#to_adocString

Returns Asciidoc to create desired link.

Returns:

  • (String)

    Asciidoc to create desired link.



48
49
50
# File 'lib/udb/doc_link.rb', line 48

def to_adoc
  "<<#{@dst_link},#{@dst_link}>>"
end