Module: LHS::Item::EndpointLookup

Extended by:
ActiveSupport::Concern
Defined in:
lib/lhs/concerns/item/endpoint_lookup.rb

Instance Method Summary collapse

Instance Method Details

#url_for_persistance!(data, options) ⇒ Object


9
10
11
12
13
14
15
16
17
18
19
# File 'lib/lhs/concerns/item/endpoint_lookup.rb', line 9

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