Sha256: 8a6ce5e6f90d5f92b7c62d9ffe31c79e5dd4affbb625bb2d989dac768a202fc6
Contents?: true
Size: 557 Bytes
Versions: 11
Compression:
Stored size: 557 Bytes
Contents
require_relative 'field' require_relative 'association' require_relative 'types' module Spectifly module Json class Builder < Spectifly::Base::Builder def build field_hashes = {} associations.each do |association| field_hashes[association.relationship] ||= {} field_hashes[association.relationship].merge! association.to_h end fields.each do |field| field_hashes.merge! field.to_h end { Spectifly::Support.tokenize(root) => field_hashes } end end end end
Version data entries
11 entries across 11 versions & 1 rubygems