Sha256: 48c01cf27e1ebdbce70c37ebb7843a1f3242c3e9d1014aa35a5b8aa7d0895e56

Contents?: true

Size: 377 Bytes

Versions: 12

Compression:

Stored size: 377 Bytes

Contents

# frozen_string_literal: true

require 'active_support'

class DHS::Record

  module HrefFor
    extend ActiveSupport::Concern

    module ClassMethods
      def href_for(args = nil)
        return unless [Integer, String].include?(args.class)
        params = { id: args }
        find_endpoint(params).compile(params)
      end
      alias url_for href_for
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
dhs-1.6.0 lib/dhs/concerns/record/href_for.rb
dhs-1.5.0 lib/dhs/concerns/record/href_for.rb
dhs-1.4.2 lib/dhs/concerns/record/href_for.rb
dhs-1.4.1 lib/dhs/concerns/record/href_for.rb
dhs-1.4.0 lib/dhs/concerns/record/href_for.rb
dhs-1.3.0 lib/dhs/concerns/record/href_for.rb
dhs-1.2.0 lib/dhs/concerns/record/href_for.rb
dhs-1.1.0 lib/dhs/concerns/record/href_for.rb
dhs-1.0.3 lib/dhs/concerns/record/href_for.rb
dhs-1.0.2 lib/dhs/concerns/record/href_for.rb
dhs-1.0.1 lib/dhs/concerns/record/href_for.rb
dhs-1.0.0 lib/dhs/concerns/record/href_for.rb