Class: CircleCI::CoverageReporter::Reporters::Link::LinkReport

Inherits:
Struct
  • Object
show all
Defined in:
lib/circleci/coverage_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



11
12
13
# File 'lib/circleci/coverage_reporter/reporters/link.rb', line 11

def base_url
  @base_url
end

#nameString

Returns the current value of name.

Returns:

  • (String)

    the current value of name



11
12
13
# File 'lib/circleci/coverage_reporter/reporters/link.rb', line 11

def name
  @name
end

#previous_urlString?

Returns the current value of previous_url.

Returns:

  • (String, nil)

    the current value of previous_url



11
12
13
# File 'lib/circleci/coverage_reporter/reporters/link.rb', line 11

def previous_url
  @previous_url
end

#urlString

Returns the current value of url.

Returns:

  • (String)

    the current value of url



11
12
13
# File 'lib/circleci/coverage_reporter/reporters/link.rb', line 11

def url
  @url
end

Instance Method Details

#to_sString

Returns:

  • (String)


13
14
15
16
17
18
19
# File 'lib/circleci/coverage_reporter/reporters/link.rb', line 13

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