Class: Pragma::Operation::Response::Created

Inherits:
Pragma::Operation::Response show all
Defined in:
lib/pragma/operation/response/created.rb

Overview

Represents the 201 Created HTTP response.

Constant Summary

Constants inherited from Pragma::Operation::Response

STATUSES

Instance Attribute Summary

Attributes inherited from Pragma::Operation::Response

#entity, #headers, #status

Instance Method Summary collapse

Methods inherited from Pragma::Operation::Response

#decorate_with, #failure?, #success?

Constructor Details

#initialize(entity: nil, headers: {}) ⇒ Created

Initializes the response.

Parameters:

  • entity (Object) (defaults to: nil)

    the response’s entity

  • headers (Hash) (defaults to: {})

    the response’s headers



12
13
14
# File 'lib/pragma/operation/response/created.rb', line 12

def initialize(entity: nil, headers: {})
  super(status: 201, entity: entity, headers: headers)
end