Sha256: 22860c5a38f76754e93aee090f5ae27bf1c4fb3bee9376ad2ae8ad9698ab92b3
Contents?: true
Size: 734 Bytes
Versions: 12
Compression:
Stored size: 734 Bytes
Contents
# frozen_string_literal: true require 'active_support' class DHS::Item < DHS::Proxy module EndpointLookup extend ActiveSupport::Concern def url_for_persistance!(data, options) return href if href.present? endpoint = endpoint_for_persistance!(data, options) endpoint.compile( merge_data_with_options(data, options) ).tap do endpoint.remove_interpolated_params!(data) endpoint.remove_interpolated_params!(options.fetch(:params, {})) options.merge!(endpoint.options.merge(options)) if endpoint.options end end private def endpoint_for_persistance!(data, options) record.find_endpoint(merge_data_with_options(data, options)) end end end
Version data entries
12 entries across 12 versions & 1 rubygems