Class: Ibex::ArtifactSet
- Inherits:
-
Object
- Object
- Ibex::ArtifactSet
- Includes:
- Enumerable, Enumerable[Artifact]
- Defined in:
- lib/ibex/artifact_set.rb,
sig/ibex/artifact_set.rbs
Overview
A generation's rendered outputs before any target is changed.
Instance Method Summary collapse
- #add(kind:, path:, content:, mode: nil) ⇒ Artifact
- #each {|arg0| ... } ⇒ Object
- #empty? ⇒ Boolean
-
#initialize ⇒ ArtifactSet
constructor
A new instance of ArtifactSet.
- #to_a ⇒ Array[Artifact]
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) ⇒ Artifact
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 ⇒ Enumerator[Artifact, ArtifactSet] #each ⇒ 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 ⇒ Array[Artifact]
54 55 56 |
# File 'lib/ibex/artifact_set.rb', line 54 def to_a @artifacts.dup end |