Exception: LiquidResponse::UnsupportedValueError

Inherits:
ArgumentError
  • Object
show all
Defined in:
lib/liquid_response/errors.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(value, key = nil) ⇒ UnsupportedValueError

Returns a new instance of UnsupportedValueError.



7
8
9
10
11
# File 'lib/liquid_response/errors.rb', line 7

def initialize(value, key = nil)
  @value = value
  @key = key
  super("Can't convert value #{value.inspect} of type #{value.class} to a liquid-compatible format")
end

Instance Attribute Details

#keyObject

Returns the value of attribute key.



5
6
7
# File 'lib/liquid_response/errors.rb', line 5

def key
  @key
end

#valueObject

Returns the value of attribute value.



5
6
7
# File 'lib/liquid_response/errors.rb', line 5

def value
  @value
end

Instance Method Details

#messageObject



13
14
15
# File 'lib/liquid_response/errors.rb', line 13

def message
  key ? "Error converting value for key '#{key}': #{super}" : super
end