Exception: Stone::Error::Overflow

Inherits:
Stone::Error show all
Defined in:
lib/stone/error/overflow.rb

Instance Attribute Summary collapse

Attributes inherited from Stone::Error

#location

Instance Method Summary collapse

Constructor Details

#initialize(message = nil, location:, literal:) ⇒ Overflow



10
11
12
13
14
# File 'lib/stone/error/overflow.rb', line 10

def initialize(message = nil, location:, literal:)
  @literal = literal
  message ||= "Overflow Error: #{literal} falls outside 64-bit Int range at line #{location.line}, column #{location.column}"
  super(message, location: location)
end

Instance Attribute Details

#literalObject (readonly)

Returns the value of attribute literal.



8
9
10
# File 'lib/stone/error/overflow.rb', line 8

def literal
  @literal
end