Exception: Rasti::Types::CastError

Inherits:
Error
  • Object
show all
Defined in:
lib/rasti/types/errors.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(type, value) ⇒ CastError



11
12
13
14
15
16
# File 'lib/rasti/types/errors.rb', line 11

def initialize(type, value)
  @type = type
  @value = value

  super "Invalid cast: #{display_value} -> #{type}"
end

Instance Attribute Details

#typeObject (readonly)

Returns the value of attribute type.



9
10
11
# File 'lib/rasti/types/errors.rb', line 9

def type
  @type
end

#valueObject (readonly)

Returns the value of attribute value.



9
10
11
# File 'lib/rasti/types/errors.rb', line 9

def value
  @value
end