Class: Ibex::BisonImport::Directive

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

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.



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

#columnObject (readonly)

: Integer



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

def column
  @column
end

#detailObject (readonly)

: String



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

def detail
  @detail
end

#lineObject (readonly)

: Integer



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

def line
  @line
end

#nameObject (readonly)

: String



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

def name
  @name
end

#statusObject (readonly)

: Symbol



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

def status
  @status
end

Instance Method Details

#to_hObject



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