Sha256: de5f864a9529afaaa27f38851438e0f66f501dc53de953339c357d50d097dac5
Contents?: true
Size: 667 Bytes
Versions: 13
Compression:
Stored size: 667 Bytes
Contents
# frozen_string_literal: true module MediaTypes class Scheme class Links def initialize self.links = {} end def link(key, allow_nil: false, &block) scheme = Scheme.new scheme.attribute :href, String, allow_nil: allow_nil scheme.instance_exec(&block) if block_given? links[key] = scheme end def validate!(output, options, **_opts) links.all? do |key, value| value.validate!( output[key], options.trace(key).exhaustive! ) end end private attr_accessor :links end end end
Version data entries
13 entries across 13 versions & 1 rubygems