Class: CircleCIReporter::Reporters::Link::LinkReport

Inherits:
Struct
  • Object
show all
Defined in:
lib/circleci_reporter/reporters/link.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#base_urlString?

Returns the current value of base_url.

Returns:

  • (String, nil)

    the current value of base_url



12
13
14
# File 'lib/circleci_reporter/reporters/link.rb', line 12

def base_url
  @base_url
end

#nameString

Returns the current value of name.

Returns:

  • (String)

    the current value of name



12
13
14
# File 'lib/circleci_reporter/reporters/link.rb', line 12

def name
  @name
end

#previous_urlString?

Returns the current value of previous_url.

Returns:

  • (String, nil)

    the current value of previous_url



12
13
14
# File 'lib/circleci_reporter/reporters/link.rb', line 12

def previous_url
  @previous_url
end

#urlString

Returns the current value of url.

Returns:

  • (String)

    the current value of url



12
13
14
# File 'lib/circleci_reporter/reporters/link.rb', line 12

def url
  @url
end

Instance Method Details

#to_sString

Returns:

  • (String)


14
15
16
17
18
19
20
# File 'lib/circleci_reporter/reporters/link.rb', line 14

def to_s
  links = []
  links << "[master](#{base_url})" if base_url
  links << "[previous](#{previous_url})" if previous_url
  link = links.empty? ? nil : " (#{links.join(', ')})"
  "[#{name}](#{url})#{link}"
end