Class: CleanArchitecture::Serializers::JsonResponseFromResult

Inherits:
Object
  • Object
show all
Extended by:
T::Sig
Defined in:
lib/clean_architecture/serializers/json_response_from_result.rb

Instance Method Summary collapse

Constructor Details

#initialize(result, http_method, success_payload_proc) ⇒ JsonResponseFromResult

Returns a new instance of JsonResponseFromResult.



16
17
18
19
20
# File 'lib/clean_architecture/serializers/json_response_from_result.rb', line 16

def initialize(result, http_method, success_payload_proc)
  @result = result
  @http_method = http_method
  @success_payload_proc = success_payload_proc
end

Instance Method Details

#to_hObject



23
24
25
26
27
28
# File 'lib/clean_architecture/serializers/json_response_from_result.rb', line 23

def to_h
  {
    status: http_status_code,
    json: json
  }
end