Sha256: fd004aba96f079f228481cdb91a9281537cfb007178c6f3376da201e631c090a
Contents?: true
Size: 636 Bytes
Versions: 14
Compression:
Stored size: 636 Bytes
Contents
module Shamu module JsonApi module BuilderMethods module Link # Write a link to another resource. # # @param [String,Symbol] name of the link. # @param [String] url # @param [Hash] meta optional additional meta information. # @return [self] def link( name, url, meta: nil ) links = ( output[:links] ||= {} ) if meta # rubocop:disable Style/ConditionalAssignment links[ name.to_sym ] = { href: url, meta: meta } else links[ name.to_sym ] = url end self end end end end end
Version data entries
14 entries across 14 versions & 1 rubygems