Exception: Sinja::UnprocessibleEntityError

Inherits:
HttpError show all
Defined in:
lib/sinja/errors.rb

Constant Summary collapse

HTTP_STATUS =
422

Instance Attribute Summary collapse

Attributes inherited from HttpError

#http_status

Instance Method Summary collapse

Constructor Details

#initialize(tuples = []) ⇒ UnprocessibleEntityError

Returns a new instance of UnprocessibleEntityError.


76
77
78
79
80
81
82
83
# File 'lib/sinja/errors.rb', line 76

def initialize(tuples=[])
  @tuples = Array(tuples)

  fail 'Tuples not properly formatted' \
    unless @tuples.any? && @tuples.all? { |t| t.instance_of?(Array) && t.length.between?(2, 3) }

  super(HTTP_STATUS)
end

Instance Attribute Details

#tuplesObject (readonly)

Returns the value of attribute tuples


74
75
76
# File 'lib/sinja/errors.rb', line 74

def tuples
  @tuples
end