Sha256: c15dc08c348b9ec8d736c120859af544eec560edf6a7d55a3e2bd7272c2cda7c
Contents?: true
Size: 436 Bytes
Versions: 11
Compression:
Stored size: 436 Bytes
Contents
module Spectifly module Json class Association < Spectifly::Base::Association def to_h fields = { :type => type, :required => required?, } [:description, :example, :restrictions].each do |opt| value = self.send(opt) if value && !value.empty? fields[opt] = value end end { name.to_sym => fields} end end end end
Version data entries
11 entries across 11 versions & 1 rubygems