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.



133
134
135
136
137
138
# File 'lib/idl/ast.rb', line 133

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.



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

def file
  @file
end

#linenoObject (readonly)

Returns the value of attribute lineno.



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

def lineno
  @lineno
end

#reasonObject (readonly)

Returns the value of attribute reason.



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

def reason
  @reason
end

Instance Method Details

#messageObject



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

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

#whatObject



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

def what = message