Sha256: 594b44615ff0941d3136c61f413518c236b1af495d517191a77798261f836578

Contents?: true

Size: 450 Bytes

Versions: 31

Compression:

Stored size: 450 Bytes

Contents

module JsonApiClient
  module Associations
    class BaseAssociation
      attr_reader :attr_name, :klass, :options
      def initialize(attr_name, klass, options = {})
        @attr_name = attr_name
        @klass = klass
        @options = options
      end

      def association_class
        @association_class ||= Utils.compute_type(klass, options.fetch(:class_name) do
          attr_name.to_s.classify
        end)
      end
    end
  end
end

Version data entries

31 entries across 31 versions & 1 rubygems

Version Path
json_api_client-0.9.6 lib/json_api_client/associations/base_association.rb
json_api_client-0.9.5 lib/json_api_client/associations/base_association.rb
json_api_client-1.0.0.beta6 lib/json_api_client/associations/base_association.rb
json_api_client-0.9.4 lib/json_api_client/associations/base_association.rb
json_api_client-0.9.3 lib/json_api_client/associations/base_association.rb
json_api_client-1.0.0.beta5 lib/json_api_client/associations/base_association.rb
json_api_client-1.0.0.beta4 lib/json_api_client/associations/base_association.rb
json_api_client-0.9.2 lib/json_api_client/associations/base_association.rb
json_api_client-1.0.0.beta3 lib/json_api_client/associations/base_association.rb
json_api_client-1.0.0.beta2 lib/json_api_client/associations/base_association.rb
json_api_client-0.9.0 lib/json_api_client/associations/base_association.rb
json_api_client-1.0.0.beta lib/json_api_client/associations/base_association.rb
json_api_client-0.8.1 lib/json_api_client/associations/base_association.rb
json_api_client-0.8.0 lib/json_api_client/associations/base_association.rb
json_api_client-0.7.1 lib/json_api_client/associations/base_association.rb
json_api_client-0.7.0 lib/json_api_client/associations/base_association.rb
json_api_client-0.6.0 lib/json_api_client/associations/base_association.rb
json_api_client-0.5.1 lib/json_api_client/associations/base_association.rb
json_api_client-0.5.0 lib/json_api_client/associations/base_association.rb
json_api_client-0.4.0 lib/json_api_client/associations/base_association.rb