Sha256: 6e367f5b5d518231c858f16f77f3a7ee48b9592a56bb2401ba40d15230c27290

Contents?: true

Size: 377 Bytes

Versions: 50

Compression:

Stored size: 377 Bytes

Contents

# frozen_string_literal: true

require 'active_support'

class LHS::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

50 entries across 50 versions & 1 rubygems

Version Path
lhs-26.2.0 lib/lhs/concerns/record/href_for.rb
lhs-26.1.0 lib/lhs/concerns/record/href_for.rb
lhs-26.0.1 lib/lhs/concerns/record/href_for.rb
lhs-26.0.0 lib/lhs/concerns/record/href_for.rb
lhs-25.2.0 lib/lhs/concerns/record/href_for.rb
lhs-25.1.0 lib/lhs/concerns/record/href_for.rb
lhs-25.0.4 lib/lhs/concerns/record/href_for.rb
lhs-25.0.3 lib/lhs/concerns/record/href_for.rb
lhs-25.0.2 lib/lhs/concerns/record/href_for.rb
lhs-25.0.1 lib/lhs/concerns/record/href_for.rb
lhs-25.0.0 lib/lhs/concerns/record/href_for.rb
lhs-24.1.2 lib/lhs/concerns/record/href_for.rb
lhs-24.1.1 lib/lhs/concerns/record/href_for.rb
lhs-24.1.0 lib/lhs/concerns/record/href_for.rb
lhs-24.1.0.pre.2 lib/lhs/concerns/record/href_for.rb
lhs-24.1.0.pre.1 lib/lhs/concerns/record/href_for.rb
lhs-24.0.0 lib/lhs/concerns/record/href_for.rb
lhs-23.0.2 lib/lhs/concerns/record/href_for.rb
lhs-23.0.1 lib/lhs/concerns/record/href_for.rb
lhs-23.0.0 lib/lhs/concerns/record/href_for.rb