Class: Ibex::ArtifactSet
- Inherits:
-
Object
- Object
- Ibex::ArtifactSet
- Includes:
- Enumerable
- Defined in:
- lib/ibex/artifact_set.rb
Overview
A generation's rendered outputs before any target is changed.
Instance Method Summary collapse
- #add(kind:, path:, content:, mode: nil) ⇒ Object
-
#each(&block) ⇒ Object
@rbs! def each: () -> Enumerator[Artifact, ArtifactSet] | () { (Artifact) -> void } -> ArtifactSet.
- #empty? ⇒ Boolean
-
#initialize ⇒ ArtifactSet
constructor
A new instance of ArtifactSet.
- #to_a ⇒ Object
Constructor Details
#initialize ⇒ ArtifactSet
Returns a new instance of ArtifactSet.
31 32 33 |
# File 'lib/ibex/artifact_set.rb', line 31 def initialize @artifacts = [] #: Array[Artifact] end |
Instance Method Details
#add(kind:, path:, content:, mode: nil) ⇒ Object
36 37 38 39 40 |
# File 'lib/ibex/artifact_set.rb', line 36 def add(kind:, path:, content:, mode: nil) artifact = Artifact.new(kind: kind, path: path, content: content, mode: mode) @artifacts << artifact artifact end |
#each(&block) ⇒ Object
@rbs! def each: () -> Enumerator[Artifact, ArtifactSet] | () { (Artifact) -> void } -> ArtifactSet
46 47 48 49 50 51 |
# File 'lib/ibex/artifact_set.rb', line 46 def each(&block) return enum_for(:each) unless block @artifacts.each(&block) self end |
#empty? ⇒ Boolean
59 60 61 |
# File 'lib/ibex/artifact_set.rb', line 59 def empty? @artifacts.empty? end |
#to_a ⇒ Object
54 55 56 |
# File 'lib/ibex/artifact_set.rb', line 54 def to_a @artifacts.dup end |