Class: Ibex::Artifact

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

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.

RBS:

  • (kind: Symbol, path: String, content: String, ?mode: Integer?) -> void

Parameters:

  • kind: (Symbol)
  • path: (String)
  • content: (String)
  • mode: (Integer, nil) (defaults to: nil)


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

#contentString (readonly)

Signature:

  • String

Returns:

  • (String)


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

def content
  @content
end

#kindSymbol (readonly)

Signature:

  • Symbol

Returns:

  • (Symbol)


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

def kind
  @kind
end

#modeInteger? (readonly)

Signature:

  • Integer?

Returns:

  • (Integer, nil)


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

def mode
  @mode
end

#pathString (readonly)

Signature:

  • String

Returns:

  • (String)


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

def path
  @path
end