Exception: Apia::InvalidScalarValueError

Inherits:
RuntimeError show all
Defined in:
lib/apia/errors/invalid_scalar_value_error.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from RuntimeError

#hash, #http_status

Constructor Details

#initialize(scalar, given_value) ⇒ InvalidScalarValueError

Returns a new instance of InvalidScalarValueError.



11
12
13
14
# File 'lib/apia/errors/invalid_scalar_value_error.rb', line 11

def initialize(scalar, given_value)
  @scalar = scalar
  @given_value = given_value
end

Instance Attribute Details

#given_valueObject (readonly)

Returns the value of attribute given_value.



9
10
11
# File 'lib/apia/errors/invalid_scalar_value_error.rb', line 9

def given_value
  @given_value
end

#scalarObject (readonly)

Returns the value of attribute scalar.



8
9
10
# File 'lib/apia/errors/invalid_scalar_value_error.rb', line 8

def scalar
  @scalar
end

Instance Method Details

#to_sObject



16
17
18
# File 'lib/apia/errors/invalid_scalar_value_error.rb', line 16

def to_s
  "Invalid value for `#{scalar.name}` (got: #{@given_value.inspect} (#{@given_value.class}))"
end