Sha256: 7d1413f0e24e1f9b4a9a0297341259d432a9826f9a1d0f7ade234eedbb2aece6

Contents?: true

Size: 458 Bytes

Versions: 1

Compression:

Stored size: 458 Bytes

Contents

# frozen_string_literal: true

require_relative 'parameter'

module Opushon
  class Response
    include Virtus.model(strict: true)

    attribute :headers, Hash[Symbol => Parameter], default: {}, required: true
    attribute :body,    Hash[Symbol => Parameter], default: {}, required: true

    def to_h
      {
        headers:  @headers.map { |k, v| [k, v.to_h] }.to_h,
        body:     @body.map    { |k, v| [k, v.to_h] }.to_h
      }
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
opushon-0.2.2 lib/opushon/response.rb