Exception: Idl::AstNode::ValueError

Inherits:
StandardError
  • Object
show all
Extended by:
T::Sig
Defined in:
lib/idlc/ast.rb

Overview

exception type raised when the value of IDL code is requested (via node.value(…)) but cannot be provided because some part the code isn’t known at compile time

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(lineno, file, reason) ⇒ ValueError

Returns a new instance of ValueError.



175
176
177
178
179
180
# File 'lib/idlc/ast.rb', line 175

def initialize(lineno, file, reason)
  super(reason)
  @lineno = lineno
  @file = file
  @reason = reason
end

Instance Attribute Details

#fileObject (readonly)

Returns the value of attribute file.



169
170
171
# File 'lib/idlc/ast.rb', line 169

def file
  @file
end

#linenoObject (readonly)

Returns the value of attribute lineno.



166
167
168
# File 'lib/idlc/ast.rb', line 166

def lineno
  @lineno
end

#reasonObject (readonly)

Returns the value of attribute reason.



172
173
174
# File 'lib/idlc/ast.rb', line 172

def reason
  @reason
end

Instance Method Details

#messageObject



186
187
188
189
190
191
192
193
# File 'lib/idlc/ast.rb', line 186

def message
  <<~WHAT
    In file #{file}
    On line #{lineno}
      A value error occurred
      #{reason}
  WHAT
end

#whatObject



183
# File 'lib/idlc/ast.rb', line 183

def what = message