Sha256: d6eb5f47bcae8e832dec5013fe4c4a3ee7cb4bb2ca81cab3b921d367d8501970

Contents?: true

Size: 487 Bytes

Versions: 17

Compression:

Stored size: 487 Bytes

Contents

module JSONAPIonify::Api
  module Resource::Builders
    module IdentityHelper
      def build_url
        URI.parse(request.root_url).tap do |uri|
          uri.path      = File.join uri.path, resource_type, build_id
          sticky_params = resource.sticky_params(context.params)
          uri.query     = sticky_params.to_param if sticky_params.present?
        end.to_s
      end

      def build_id
        IdBuilder.build(resource, instance: instance)
      end
    end
  end
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
jsonapionify-0.12.10 lib/jsonapionify/api/resource/builders/identity_helper.rb
jsonapionify-0.12.9 lib/jsonapionify/api/resource/builders/identity_helper.rb
jsonapionify-0.12.8 lib/jsonapionify/api/resource/builders/identity_helper.rb
jsonapionify-0.12.7 lib/jsonapionify/api/resource/builders/identity_helper.rb
jsonapionify-0.12.5 lib/jsonapionify/api/resource/builders/identity_helper.rb
jsonapionify-0.12.4 lib/jsonapionify/api/resource/builders/identity_helper.rb
jsonapionify-0.12.3 lib/jsonapionify/api/resource/builders/identity_helper.rb
jsonapionify-0.12.2 lib/jsonapionify/api/resource/builders/identity_helper.rb
jsonapionify-0.12.1 lib/jsonapionify/api/resource/builders/identity_helper.rb
jsonapionify-0.12.0 lib/jsonapionify/api/resource/builders/identity_helper.rb
jsonapionify-0.11.11 lib/jsonapionify/api/resource/builders/identity_helper.rb
jsonapionify-0.11.10 lib/jsonapionify/api/resource/builders/identity_helper.rb
jsonapionify-0.11.9 lib/jsonapionify/api/resource/builders/identity_helper.rb
jsonapionify-0.11.8 lib/jsonapionify/api/resource/builders/identity_helper.rb
jsonapionify-0.11.7 lib/jsonapionify/api/resource/builders/identity_helper.rb
jsonapionify-0.11.6 lib/jsonapionify/api/resource/builders/identity_helper.rb
jsonapionify-0.11.5 lib/jsonapionify/api/resource/builders/identity_helper.rb