module Shamu::JsonApi::BuilderMethods::Link
Public Instance Methods
link( name, url, meta: nil )
click to toggle source
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]
# File lib/shamu/json_api/builder_methods/link.rb, line 11 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