Class: Ibex::Artifact

Inherits:
Object
  • Object
show all
Defined in:
lib/ibex/artifact_set.rb

Overview

One fully rendered file in a parser generation.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(kind:, path:, content:, mode: nil) ⇒ Artifact

Returns a new instance of Artifact.

Raises:

  • (ArgumentError)


13
14
15
16
17
18
19
20
21
# File 'lib/ibex/artifact_set.rb', line 13

def initialize(kind:, path:, content:, mode: nil)
  raise ArgumentError, "artifact path must not be empty" if path.empty?

  @kind = kind
  @path = path.dup.freeze
  @content = content.dup.freeze
  @mode = mode
  freeze
end

Instance Attribute Details

#contentObject (readonly)

: String



9
10
11
# File 'lib/ibex/artifact_set.rb', line 9

def content
  @content
end

#kindObject (readonly)

: Symbol



7
8
9
# File 'lib/ibex/artifact_set.rb', line 7

def kind
  @kind
end

#modeObject (readonly)

: Integer?



10
11
12
# File 'lib/ibex/artifact_set.rb', line 10

def mode
  @mode
end

#pathObject (readonly)

: String



8
9
10
# File 'lib/ibex/artifact_set.rb', line 8

def path
  @path
end