Sha256: 390f535873e57942d45382f10fbee12ead3711f3b93e9661856eda4305a15584

Contents?: true

Size: 427 Bytes

Versions: 2

Compression:

Stored size: 427 Bytes

Contents

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

2 entries across 2 versions & 1 rubygems

Version Path
opushon-0.2.1 lib/opushon/response.rb
opushon-0.2 lib/opushon/response.rb