Class: Ibex::ErrorMessages::Entry

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

Overview

One active or archived error-sentence entry with its source line.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(state:, status:, message:, line:, sentence: nil, error_id: nil, entry: nil) ⇒ Entry

Returns a new instance of Entry.

RBS:

  • (state: Integer?, status: :active | :unreachable | :removed, message: String?, line: Integer, ?sentence: Array[String]?, ?error_id: String?, ?entry: String?) -> void

Parameters:

  • state: (Integer, nil)
  • status: (:active, :unreachable, :removed)
  • message: (String, nil)
  • line: (Integer)
  • sentence: (Array[String], nil) (defaults to: nil)
  • error_id: (String, nil) (defaults to: nil)
  • entry: (String, nil) (defaults to: nil)


25
26
27
28
29
30
31
32
33
34
# File 'lib/ibex/error_messages.rb', line 25

def initialize(state:, status:, message:, line:, sentence: nil, error_id: nil, entry: nil)
  @state = state
  @status = status
  @message = message&.freeze
  @line = line
  @sentence = sentence&.dup&.freeze
  @error_id = error_id&.freeze
  @entry = entry&.freeze
  freeze
end

Instance Attribute Details

#entryString? (readonly)

Signature:

  • String?

Returns:

  • (String, nil)


21
22
23
# File 'lib/ibex/error_messages.rb', line 21

def entry
  @entry
end

#error_idString? (readonly)

Signature:

  • String?

Returns:

  • (String, nil)


20
21
22
# File 'lib/ibex/error_messages.rb', line 20

def error_id
  @error_id
end

#lineInteger (readonly)

Signature:

  • Integer

Returns:

  • (Integer)


18
19
20
# File 'lib/ibex/error_messages.rb', line 18

def line
  @line
end

#messageString? (readonly)

Signature:

  • String?

Returns:

  • (String, nil)


17
18
19
# File 'lib/ibex/error_messages.rb', line 17

def message
  @message
end

#sentenceArray[String]? (readonly)

Signature:

  • Array[String]?

Returns:

  • (Array[String], nil)


19
20
21
# File 'lib/ibex/error_messages.rb', line 19

def sentence
  @sentence
end

#stateInteger? (readonly)

Signature:

  • Integer?

Returns:

  • (Integer, nil)


15
16
17
# File 'lib/ibex/error_messages.rb', line 15

def state
  @state
end

#status:active, ... (readonly)

Signature:

  • :active | :unreachable | :removed

Returns:

  • (:active, :unreachable, :removed)


16
17
18
# File 'lib/ibex/error_messages.rb', line 16

def status
  @status
end