Exception: Altair::ConversionError

Inherits:
StandardError
  • Object
show all
Defined in:
lib/altair/conversion_error.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(type, value) ⇒ ConversionError

Returns a new instance of ConversionError.



5
6
7
8
# File 'lib/altair/conversion_error.rb', line 5

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

Instance Attribute Details

#typeObject (readonly)

Returns the value of attribute type.



3
4
5
# File 'lib/altair/conversion_error.rb', line 3

def type
  @type
end

#valueObject (readonly)

Returns the value of attribute value.



3
4
5
# File 'lib/altair/conversion_error.rb', line 3

def value
  @value
end

Instance Method Details

#messageObject



10
11
12
# File 'lib/altair/conversion_error.rb', line 10

def message
  "Cannot convert `#{value}` (of class #{value.class}) to #{type}"
end