Sha256: 3feb6931db46d60a3670a94aac763e7d3a7107f7f0bbd56b2f59006b34fd9c88
Contents?: true
Size: 1.25 KB
Versions: 8
Compression:
Stored size: 1.25 KB
Contents
# frozen_string_literal: true require 'deterministic' require 'dry-struct' require 'dry-types' require 'json' module Salestation class Web < Module module Types include Dry::Types.module end def initialize(errors: {}) @error_mapper = ErrorMapper.new(errors) end def included(base) error_mapper = @error_mapper base.class_eval do const_set :Responses, Salestation::Web::Responses define_method(:process) do |response| result = if response.value.is_a?(Salestation::Web::Responses::Response) response.value else response.map_err(error_mapper.map).value end status result.status headers result.headers json result.body end end end end end require_relative './web/extractors' require_relative './web/responses' require_relative './web/error_mapper' require_relative './result_helper' require_relative './web/active_record_connection_management' require_relative './web/request_logger' require_relative './web/statsd_middleware' require_relative './web/input_validator' require_relative './web/input_validators/accept_header' require_relative './web/input_validators/content_type_header'
Version data entries
8 entries across 8 versions & 1 rubygems