Class: CircleCI::CoverageReporter::Artifact
- Inherits:
-
Struct
- Object
- Struct
- CircleCI::CoverageReporter::Artifact
- Defined in:
- lib/circleci/coverage_reporter/artifact.rb
Overview
Encapsulate a CircleCI artifact
Instance Attribute Summary collapse
-
#node_index ⇒ Integer
the ID of the artifact's container.
-
#path ⇒ String
abstract path to the artifact in CircleCI container.
-
#url ⇒ String
URL of the artifact.
Instance Method Summary collapse
-
#body ⇒ String
Content of the artifact.
- #match?(value, node_index: nil) ⇒ Boolean
Instance Attribute Details
#node_index ⇒ Integer
the ID of the artifact's container
8 9 10 |
# File 'lib/circleci/coverage_reporter/artifact.rb', line 8 def node_index @node_index end |
#path ⇒ String
abstract path to the artifact in CircleCI container
8 9 10 |
# File 'lib/circleci/coverage_reporter/artifact.rb', line 8 def path @path end |
#url ⇒ String
URL of the artifact
8 9 10 |
# File 'lib/circleci/coverage_reporter/artifact.rb', line 8 def url @url end |
Instance Method Details
#body ⇒ String
Returns content of the artifact.
17 18 19 |
# File 'lib/circleci/coverage_reporter/artifact.rb', line 17 def body @body ||= CoverageReporter.client.get(url).body end |
#match?(value, node_index: nil) ⇒ Boolean
12 13 14 |
# File 'lib/circleci/coverage_reporter/artifact.rb', line 12 def match?(value, node_index: nil) path.end_with?(value) && (node_index.nil? || self.node_index == node_index) end |