module HalApi::Representer::UriMethods::ClassMethods
Public Instance Methods
alternate_link()
click to toggle source
# File lib/hal_api/representer/uri_methods.rb, line 37 def alternate_link link :alternate do { href: alternate_url(model_path(represented)), type: 'text/html' } end end
profile_link()
click to toggle source
# File lib/hal_api/representer/uri_methods.rb, line 33 def profile_link link(:profile) { profile_url(represented) } end
self_link()
click to toggle source
# File lib/hal_api/representer/uri_methods.rb, line 15 def self_link link(:self) do { href: self_url(represented), profile: profile_url(represented) } end end
vary_link()
click to toggle source
# File lib/hal_api/representer/uri_methods.rb, line 24 def vary_link link(:vary) do { href: vary_url(represented) + vary_query_params, templated: true, } if vary_url(represented).present? && vary_params.present? end end