Class: Ibex::BisonImport::Directive

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

Overview

One directive occurrence and its original source position.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name:, status:, line:, column:, detail:) ⇒ Directive

Returns a new instance of Directive.

RBS:

  • (name: String, status: Symbol, line: Integer, column: Integer, detail: String) -> void

Parameters:

  • name: (String)
  • status: (Symbol)
  • line: (Integer)
  • column: (Integer)
  • detail: (String)


80
81
82
83
84
85
86
87
# File 'lib/ibex/bison_import.rb', line 80

def initialize(name:, status:, line:, column:, detail:)
  @name = name.freeze
  @status = status
  @line = line
  @column = column
  @detail = detail.freeze
  freeze
end

Instance Attribute Details

#columnInteger (readonly)

Signature:

  • Integer

Returns:

  • (Integer)


76
77
78
# File 'lib/ibex/bison_import.rb', line 76

def column
  @column
end

#detailString (readonly)

Signature:

  • String

Returns:

  • (String)


77
78
79
# File 'lib/ibex/bison_import.rb', line 77

def detail
  @detail
end

#lineInteger (readonly)

Signature:

  • Integer

Returns:

  • (Integer)


75
76
77
# File 'lib/ibex/bison_import.rb', line 75

def line
  @line
end

#nameString (readonly)

Signature:

  • String

Returns:

  • (String)


73
74
75
# File 'lib/ibex/bison_import.rb', line 73

def name
  @name
end

#statusSymbol (readonly)

Signature:

  • Symbol

Returns:

  • (Symbol)


74
75
76
# File 'lib/ibex/bison_import.rb', line 74

def status
  @status
end

Instance Method Details

#to_hHash[Symbol, Object?]

RBS:

  • () -> Hash[Symbol, Object?]

Returns:

  • (Hash[Symbol, Object?])


90
91
92
# File 'lib/ibex/bison_import.rb', line 90

def to_h
  { name: @name, status: @status, line: @line, column: @column, detail: @detail }
end