Class: ROM::HTTP::Schema

Inherits:
Schema
  • Object
show all
Defined in:
lib/rom/http/schema.rb,
lib/rom/http/schema/dsl.rb

Defined Under Namespace

Classes: DSL

Instance Method Summary collapse

Instance Method Details

#to_output_hashObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Customized output hash constructor which symbolizes keys and optionally applies custom read-type coercions



13
14
15
16
17
# File 'lib/rom/http/schema.rb', line 13

def to_output_hash
  Types::Hash
    .schema(map { |attr| [attr.key, attr.to_read_type] }.to_h)
    .with_key_transform(&:to_sym)
end