Exception: Idl::AstNode::ValueError

Inherits:
StandardError
  • Object
show all
Defined in:
lib/idl/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.



131
132
133
134
135
136
# File 'lib/idl/ast.rb', line 131

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.



129
130
131
# File 'lib/idl/ast.rb', line 129

def file
  @file
end

#linenoObject (readonly)

Returns the value of attribute lineno.



129
130
131
# File 'lib/idl/ast.rb', line 129

def lineno
  @lineno
end

#reasonObject (readonly)

Returns the value of attribute reason.



129
130
131
# File 'lib/idl/ast.rb', line 129

def reason
  @reason
end

Instance Method Details

#messageObject



140
141
142
143
144
145
146
147
# File 'lib/idl/ast.rb', line 140

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

#whatObject



138
# File 'lib/idl/ast.rb', line 138

def what = message