Method: Hoodoo::Errors#render

Defined in:
lib/hoodoo/errors/errors.rb

#render(interaction_id) ⇒ Object

Return a Hash rendered through the Hoodoo::Data::Resources::Errors collection representing the formalised resource.

interaction_id

Mandatory Interaction ID (UUID) to associate with the collection.



238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
# File 'lib/hoodoo/errors/errors.rb', line 238

def render( interaction_id )
  unless Hoodoo::UUID.valid?( interaction_id )
    raise "Hoodoo::Errors\#render must be given a valid Interaction ID (got '#{ interaction_id.inspect }')"
  end

  @created_at ||= Time.now

  Hoodoo::Data::Resources::Errors.render(
    {
      'interaction_id' => interaction_id,
      'errors'         => @errors
    },
    @uuid,
    @created_at
  )
end